From 6775f89c2ed5038fd57f83f143154e78acd45e2f Mon Sep 17 00:00:00 2001 From: Massimo DiPierro Date: Sat, 19 May 2012 10:07:56 -0500 Subject: [PATCH] fixed logging issue (807), thanks Marc --- VERSION | 2 +- gluon/main.py | 7 +++++++ gluon/rewrite.py | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 77c5d028..23782032 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-05-17 18:13:53) dev +Version 2.00.0 (2012-05-19 10:07:52) dev diff --git a/gluon/main.py b/gluon/main.py index 57bf6476..2f69c6ba 100644 --- a/gluon/main.py +++ b/gluon/main.py @@ -68,6 +68,13 @@ create_missing_folders() # set up logging for subsequent imports import logging import logging.config + +# This needed to prevent exception on Python 2.5: +# NameError: name 'gluon' is not defined +# See http://bugs.python.org/issue1436 +import gluon.messageboxhandler +logging.gluon = gluon + logpath = abspath("logging.conf") if os.path.exists(logpath): logging.config.fileConfig(abspath("logging.conf")) diff --git a/gluon/rewrite.py b/gluon/rewrite.py index 1e76acbb..b6ee5f6a 100644 --- a/gluon/rewrite.py +++ b/gluon/rewrite.py @@ -1016,13 +1016,16 @@ class MapUrlIn(object): self.request.args = self.args if self.language: self.request.uri_language = self.language - uri = '/%s/%s/%s' % (self.application, self.controller, self.function) + uri = '/%s/%s' % (self.controller, self.function) + app = self.application if self.map_hyphen: uri = uri.replace('_', '-') + app = app.replace('_', '-') if self.extension != 'html': uri += '.' + self.extension if self.language: uri = '/%s%s' % (self.language, uri) + uri = '/%s%s' % (app, uri) uri += self.args and urllib.quote('/' + '/'.join([str(x) for x in self.args])) or '' uri += (self.query and ('?' + self.query) or '') self.env['REQUEST_URI'] = uri