diff --git a/pyulib/src/ulib/web/pages.py b/pyulib/src/ulib/web/pages.py index 5ba7236..cbc455e 100644 --- a/pyulib/src/ulib/web/pages.py +++ b/pyulib/src/ulib/web/pages.py @@ -8,7 +8,7 @@ from os import path from ulib.base.base import isstr, isbool, isnum, isflt, seqof, make_prop from ulib.base.uio import _u, Utf8IO -from ulib.base.output import enote +from ulib.base.output import enote, edebug from ulib.base.args import get_args from ulib.base.dates import rfc2822 from ulib.base.functions import apply_args @@ -246,11 +246,14 @@ class Page(object): self.NAME = name self.METHOD = method m = None + if m is None and name is not None and hasattr(self, name): + m = getattr(self, name) if m is None and hasattr(self, self.__class__.__name__): m = getattr(self, self.__class__.__name__) if m is None and hasattr(self, 'index'): m = getattr(self, 'index') - if m is None: m = self.error + if m is None: + m = self.error # XXX Ajouter un argument en fonction de la valeur du header Accept:, pour text/plain, # text/html, application/xml et application/xhtml+xml return apply_args(m, method) @@ -337,6 +340,7 @@ class Application(object): est prévue pour être dérivée. """ if web.config.debug: + edebug(u"Configuration des routes: %s" % str(self.webapp.mapping)) enote(u"Lancement du serveur sur http://%s:%i" % (self.HOST, self.PORT)) def new_render(self, templatedir=None):