]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Make tests work without installation
authorArmin Ronacher <armin.ronacher@active-4.com>
Sat, 27 Jul 2013 10:43:13 +0000 (12:43 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Sat, 27 Jul 2013 10:43:13 +0000 (12:43 +0200)
babel/messages/extract.py
setup.py

index 44b1eb38ce2b36d63afb88e31e3721869edc44be..2f8084af5378083a7161b9bd23c2f1c24fb3085f 100644 (file)
@@ -252,7 +252,11 @@ def extract(method, fileobj, keywords=DEFAULT_KEYWORDS, comment_tags=(),
             # if pkg_resources is not available or no usable egg-info was found
             # (see #230), we resort to looking up the builtin extractors
             # directly
-            builtin = {'ignore': extract_nothing, 'python': extract_python}
+            builtin = {
+                'ignore': extract_nothing,
+                'python': extract_python,
+                'javascript': extract_javascript
+            }
             func = builtin.get(method)
     if func is None:
         raise ValueError('Unknown extraction method %r' % method)
index 301e7a7a584742ba974bfe074408e87fd688ca78..e983658f4bfb94de44067521db23507a4a070f49 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -65,6 +65,10 @@ setup(
 
     zip_safe=False,
 
+    # Note when adding extractors: builtin extractors we also want to
+    # work if packages are not installed to simplify testing.  If you
+    # add an extractor here also manually add it to the "extract"
+    # function in babel.messages.extract.
     entry_points="""
     [console_scripts]
     pybabel = babel.messages.frontend:main