From 5c4261a2676756eb515ec39a884af92eaae0aa31 Mon Sep 17 00:00:00 2001 From: Adam Blackburn Date: Sat, 2 May 2009 15:24:50 +0800 Subject: [PATCH] added support for automatically retrieving translations.py --- setup.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 376552c..4ebc6aa 100755 --- a/setup.py +++ b/setup.py @@ -332,6 +332,26 @@ class test(Command): print 'running tests' tests.run_tests() +class update_translations_py(Command): + description = "download new translations.py from the online translator" + + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + import urllib, shutil + # grab translations.py + filename, headers = urllib.urlretrieve('http://wicd.net/translator/generate/translations.py/') + # copy it into the right location + shutil.copyfile(filename, + os.path.join(os.path.dirname(os.path.realpath(__file__)), + 'wicd/translations.py')) + class get_translations(Command): description = "download the translations from the online translator" @@ -482,7 +502,9 @@ iwscan_ext = Extension(name='iwscan', libraries=['iw'], sources=['depends/python-iwscan/pyiwscan.c']) setup(cmdclass={'configure' : configure, 'get_translations' : get_translations, - 'uninstall' : uninstall, 'test' : test, 'clear_generated' : clear_generated}, + 'uninstall' : uninstall, 'test' : test, 'clear_generated' : + clear_generated, 'update_translations_py' : + update_translations_py}, name="Wicd", version=VERSION_NUM, description="A wireless and wired network manager",