[Python-checkins] r66353 - doctools/trunk/setup.py

georg.brandl python-checkins at python.org
Tue Sep 9 23:19:11 CEST 2008


Author: georg.brandl
Date: Tue Sep  9 23:19:11 2008
New Revision: 66353

Log:
Fix setup.py when babel is unavailable.


Modified:
   doctools/trunk/setup.py

Modified: doctools/trunk/setup.py
==============================================================================
--- doctools/trunk/setup.py	(original)
+++ doctools/trunk/setup.py	Tue Sep  9 23:19:11 2008
@@ -59,8 +59,6 @@
 # Provide a "compile_catalog" command that also creates the translated
 # JavaScript files if Babel is available.
 
-cmdclass = {}
-
 try:
     from babel.messages.pofile import read_po
     from babel.messages.frontend import compile_catalog
@@ -69,11 +67,7 @@
     except ImportError:
         from json import dump
 except ImportError:
-    class compile_catalog_plusjs(compile_catalog):
-        def run(self):
-            compile_catalog.run(self)
-            log.warn('simplejson/json or babel is not available; not writing '
-                     'JavaScript translation files.')
+    pass
 else:
     class compile_catalog_plusjs(compile_catalog):
         """
@@ -150,7 +144,7 @@
                 finally:
                     outfile.close()
 
-cmdclass['compile_catalog'] = compile_catalog_plusjs
+    cmdclass['compile_catalog'] = compile_catalog_plusjs
 
 
 setup(


More information about the Python-checkins mailing list