From: Simo Sorce Date: Tue, 25 Feb 2014 00:58:10 +0000 (-0500) Subject: Add _debug facility to the Page class X-Git-Tag: v0.2.2~97 X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fipsilon.git;a=commitdiff_plain;h=0d81fcba2c57e9dfb2d55bbbcc1dfff3aaae25bd Add _debug facility to the Page class Use this instead of th misleading "_log" name. These really are just debugging statements not normal logging. Signed-off-by: Simo Sorce --- diff --git a/ipsilon/login/common.py b/ipsilon/login/common.py index 578ec63..4888060 100755 --- a/ipsilon/login/common.py +++ b/ipsilon/login/common.py @@ -79,14 +79,14 @@ class Login(Page): plugins = self._site[FACILITY] available = plugins['available'].keys() - self._log('Available login managers: %s' % str(available)) + self._debug('Available login managers: %s' % str(available)) prev_obj = None for item in plugins['whitelist']: - self._log('Login plugin in whitelist: %s' % item) + self._debug('Login plugin in whitelist: %s' % item) if item not in plugins['available']: continue - self._log('Login plugin enabled: %s' % item) + self._debug('Login plugin enabled: %s' % item) plugins['enabled'].append(item) obj = plugins['available'][item] if prev_obj: @@ -98,10 +98,6 @@ class Login(Page): obj.set_config(plugins['config'][item]) self.__dict__[item] = obj.get_tree(self._site) - def _log(self, fact): - if cherrypy.config.get('debug', False): - cherrypy.log(fact) - def root(self, *args, **kwargs): if self.first_login: raise cherrypy.HTTPRedirect('%s/login/%s' % diff --git a/ipsilon/util/page.py b/ipsilon/util/page.py index 2cdca1c..56a6463 100755 --- a/ipsilon/util/page.py +++ b/ipsilon/util/page.py @@ -62,6 +62,10 @@ class Page(object): m.update(kwargs) return t.render(**m) + def _debug(self, fact): + if cherrypy.config.get('debug', False): + cherrypy.log(fact) + def default(self, *args, **kwargs): raise cherrypy.HTTPError(404)