]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Added a setup.py command for building and importing the cldr
authorArmin Ronacher <armin.ronacher@active-4.com>
Sun, 7 Jul 2013 21:37:59 +0000 (23:37 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Sun, 7 Jul 2013 21:37:59 +0000 (23:37 +0200)
INSTALL.txt
MANIFEST.in
setup.py

index 41a9ec411bfc1b7be012a5dd8f0498dfa0192aeb..405173962dfc7219185d7bcb1dd2286e4f52e924 100644 (file)
@@ -23,10 +23,9 @@ site-packages directory on your system.  It's recommended to use a
 virtualenv instead.
 
 If you have a git checkout instead of a source release you will need
-to convert the CLDR sources.  This can be done fully automated by
-the download script:
+to convert the CLDR sources:
 
-  $ python ./scripts/download_import_cldr.py
+  $ python setup.py import_cldr install
 
 For advanced options, please refer to the easy_install and/or the distutils
 documentation:
index d11a9498d81fee367353a83b42dd42e581cfb5b2..15386d7f8a497e99f971d9a20db9d69a3594278c 100644 (file)
@@ -2,3 +2,4 @@ include babel/global.dat
 include babel/localedata/*.dat
 include doc/api/*.*
 include doc/*.html
+include scripts/*
index a5ae639f17f5defc89e10a84b2bbb3bc8436987a..036c6eac8e6e644a247eeeae5260dab55254a829 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -14,6 +14,7 @@
 
 import os
 import sys
+import subprocess
 from setuptools import setup
 
 sys.path.append(os.path.join('doc', 'common'))
@@ -23,6 +24,24 @@ except ImportError:
     build_doc = test_doc = None
 
 
+from distutils.cmd import Command
+
+
+class import_cldr(Command):
+    description = 'imports and converts the CLDR data'
+    user_options = []
+
+    def initialize_options(self):
+        pass
+
+    def finalize_options(self):
+        pass
+
+    def run(self):
+        c = subprocess.Popen([sys.executable, 'scripts/download_import_cldr.py'])
+        c.wait()
+
+
 setup(
     name = 'Babel',
     version = '1.0',
@@ -55,7 +74,8 @@ setup(
         'pytz',
     ],
 
-    cmdclass = {'build_doc': build_doc, 'test_doc': test_doc},
+    cmdclass = {'build_doc': build_doc, 'test_doc': test_doc,
+                'import_cldr': import_cldr},
 
     zip_safe = False,
     test_suite = 'babel.tests.suite',