changeset 1131:67044a2a0224

add some more timers, fix wrong path in i18n_init
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 06 Aug 2006 18:02:58 +0200
parents 787e963c9bfd
children f9d8b80f5afb 35e021959906
files MoinMoin/i18n/__init__.py MoinMoin/request/__init__.py
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/i18n/__init__.py	Sun Aug 06 17:13:53 2006 +0200
+++ b/MoinMoin/i18n/__init__.py	Sun Aug 06 18:02:58 2006 +0200
@@ -61,10 +61,11 @@
         The very first time, this will be slow as it will load all languages,
         but next time it will be fast due to caching.
     """
+    request.clock.start('i18n_init')
     global languages
     if languages is None:
         meta_cache = caching.CacheEntry(request, 'i18n', 'meta', scope='farm')
-        i18n_dir = os.path.join(request.cfg.moinmoin_dir, 'i18n', 'mo')
+        i18n_dir = os.path.join(request.cfg.moinmoin_dir, 'i18n')
         if meta_cache.needsUpdate(i18n_dir):
             _languages = {}
             for lang_file in glob.glob(po_filename(request, language='*', domain='MoinMoin')): # only MoinMoin domain for now XXX
@@ -85,6 +86,7 @@
         _languages = pickle.loads(meta_cache.content())
         if languages is None:
             languages = _languages
+    request.clock.stop('i18n_init')
 
 
 class Translation(object):
--- a/MoinMoin/request/__init__.py	Sun Aug 06 17:13:53 2006 +0200
+++ b/MoinMoin/request/__init__.py	Sun Aug 06 18:02:58 2006 +0200
@@ -144,6 +144,7 @@
             self.writestack = []
             self.clock = Clock()
             self.clock.start('total')
+            self.clock.start('base__init__')
             # order is important here!
             self.__dict__.update(properties)
             self._load_multi_cfg()
@@ -180,7 +181,7 @@
 
             rootname = u''
             self.rootpage = Page(self, rootname, is_rootpage=1)
-
+            
             from MoinMoin import i18n
             self.i18n = i18n
             i18n.i18n_init(self)
@@ -205,6 +206,7 @@
 
             self.opened_logs = 0
             self.reset()
+            self.clock.stop('base__init__')
 
     def surge_protect(self):
         """ check if someone requesting too much from us """