mod python confusion

Robert Brewer fumanchu at amor.org
Sat May 29 11:16:56 EDT 2004


Whoops!
>     dispatches = {'default.htm': default,
>                   'view.htm': view,
>                   'edit.htm': edit,
>                   }
>     
>     try:
>         nextHandler = self.dispatches[script]
>     except KeyError:
>         nextHandler = self.dispatches['default.htm']
>     return nextHandler(req)

You should just write:

          nextHandler = dispatches[script]

...instead of self.dispatches.


FuManChu




More information about the Python-list mailing list