mirror of
https://github.com/gryf/wicd.git
synced 2025-12-19 12:28:08 +01:00
Merged setup.py changes from experimental-nacl, r293.
This commit is contained in:
11
setup.py
11
setup.py
@@ -289,7 +289,7 @@ class configure(Command):
|
||||
item_in.close()
|
||||
shutil.copymode(original_name, final_name)
|
||||
|
||||
class cleargenerated(Command):
|
||||
class clear_generated(Command):
|
||||
description = 'clears out files generated by configure'
|
||||
|
||||
user_options = []
|
||||
@@ -346,21 +346,22 @@ class get_translations(Command):
|
||||
import urllib, shutil
|
||||
shutil.rmtree('translations/')
|
||||
os.makedirs('translations')
|
||||
filename, headers = urllib.urlretrieve('http://wicd.net/translator/get_id_list.php')
|
||||
filename, headers = urllib.urlretrieve('http://wicd.net/translator/idlist')
|
||||
id_file = open(filename, 'r')
|
||||
lines = id_file.readlines()
|
||||
# remove the \n from the end of lines, and remove blank entries
|
||||
lines = [ x.strip() for x in lines if not x.strip() is '' ]
|
||||
for id in lines:
|
||||
# http://wicd.net/translator/download_po.php?language=11
|
||||
pofile, poheaders = urllib.urlretrieve('http://wicd.net/translator/download_po.php?language='+str(id))
|
||||
pofile, poheaders = urllib.urlretrieve('http://wicd.net/translator/download/'+str(id))
|
||||
#for i in `cat ids`; do
|
||||
#wget "http://wicd.sourceforge.net/translator/download_po.php?language=$i&version=$1" -O "language_$i"
|
||||
#iden=`python -c "import sys; print open('language_$i','r').readlines()[1].strip()[2:]"`
|
||||
#mv "language_$i" po/$iden.po
|
||||
#mkdir -p $iden/LC_MESSAGES/
|
||||
#msgfmt --output-file=$iden/LC_MESSAGES/wicd.mo po/$iden.po
|
||||
lang_identifier = open(pofile,'r').readlines()[1].strip()[2:]
|
||||
lang_identifier = open(pofile,'r').readlines()[0].strip()
|
||||
lang_identifier = lang_identifier[lang_identifier.rindex('(')+1:lang_identifier.rindex(')')]
|
||||
shutil.move(pofile, lang_identifier+'.po')
|
||||
print 'Got',lang_identifier
|
||||
os.makedirs('translations/'+lang_identifier+'/LC_MESSAGES')
|
||||
@@ -486,7 +487,7 @@ 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, 'cleargenerated' : cleargenerated},
|
||||
'uninstall' : uninstall, 'test' : test, 'clear_generated' : clear_generated},
|
||||
name="Wicd",
|
||||
version=VERSION_NUM,
|
||||
description="A wireless and wired network manager",
|
||||
|
||||
Reference in New Issue
Block a user