summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2013-07-27 12:43:13 +0200
committerArmin Ronacher <armin.ronacher@active-4.com>2013-07-27 12:43:13 +0200
commitaf9834dd14df039dee45a86a94ec17f3a8bc8f44 (patch)
tree9bf447aeafeb38b21015a3eecf41ec802c188d46
parentd45522fb1d6484cb1bb494cae93650c25d68f4d4 (diff)
downloadbabel-af9834dd14df039dee45a86a94ec17f3a8bc8f44.tar.gz
Make tests work without installation
-rw-r--r--babel/messages/extract.py6
-rwxr-xr-xsetup.py4
2 files changed, 9 insertions, 1 deletions
diff --git a/babel/messages/extract.py b/babel/messages/extract.py
index 44b1eb3..2f8084a 100644
--- a/babel/messages/extract.py
+++ b/babel/messages/extract.py
@@ -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)
diff --git a/setup.py b/setup.py
index 301e7a7..e983658 100755
--- 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