changeset 5396:a8c445a6d37e

do not use i18n.wikiLanguages() on class level, fails when tools import the module (e.g. pydoc -k foo)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 15 Dec 2009 05:46:53 +0100
parents 897cdbe9e8f2
children 6e7f1b059a3c bba0ab704aa9
files MoinMoin/macro/__init__.py
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/__init__.py	Tue Jun 09 00:45:52 2009 +0200
+++ b/MoinMoin/macro/__init__.py	Tue Dec 15 05:46:53 2009 +0100
@@ -74,11 +74,6 @@
         "GetVal": ["pages"],
         }
 
-    # we need the lang macros to execute when html is generated,
-    # to have correct dir and lang html attributes
-    for lang in i18n.wikiLanguages():
-        Dependencies[lang] = []
-
 
     def __init__(self, parser):
         self.parser = parser
@@ -91,6 +86,12 @@
         # Initialized on execute
         self.name = None
 
+        # we need the lang macros to execute when html is generated,
+        # to have correct dir and lang html attributes
+        # note: i18n needs to be initialized first before .wikiLanguages() will work
+        for lang in i18n.wikiLanguages():
+            self.Dependencies[lang] = []
+
     def _wrap(self, function, args, fixed=[]):
         try:
             return wikiutil.invoke_extension_function(self.request, function,