mirror of
https://github.com/gryf/wicd.git
synced 2025-12-19 12:28:08 +01:00
add .sourceforge.net to the URLs in the translator
This commit is contained in:
33
setup.py
33
setup.py
@@ -20,6 +20,7 @@
|
|||||||
from distutils.core import setup, Command
|
from distutils.core import setup, Command
|
||||||
from distutils.extension import Extension
|
from distutils.extension import Extension
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
@@ -411,28 +412,26 @@ class get_translations(Command):
|
|||||||
import urllib, shutil
|
import urllib, shutil
|
||||||
shutil.rmtree('translations/')
|
shutil.rmtree('translations/')
|
||||||
os.makedirs('translations')
|
os.makedirs('translations')
|
||||||
filename, headers = urllib.urlretrieve('http://wicd.net/translator/idlist')
|
filename, headers = urllib.urlretrieve('http://wicd.sourceforge.net/translator/idlist/')
|
||||||
id_file = open(filename, 'r')
|
id_file = open(filename, 'r')
|
||||||
lines = id_file.readlines()
|
lines = id_file.readlines()
|
||||||
# remove the \n from the end of lines, and remove blank entries
|
# remove the \n from the end of lines, and remove blank entries
|
||||||
lines = [ x.strip() for x in lines if not x.strip() is '' ]
|
lines = [ x.strip() for x in lines if not x.strip() is '' ]
|
||||||
for id in lines:
|
for id in lines:
|
||||||
# http://wicd.net/translator/download_po.php?language=11
|
pofile, poheaders = urllib.urlretrieve('http://wicd.sourceforge.net/translator/download/'+str(id)+'/')
|
||||||
pofile, poheaders = urllib.urlretrieve('http://wicd.net/translator/download/'+str(id))
|
try:
|
||||||
#for i in `cat ids`; do
|
lang_identifier = open(pofile,'r').readlines()[0].strip()
|
||||||
#wget "http://wicd.sourceforge.net/translator/download_po.php?language=$i&version=$1" -O "language_$i"
|
first_line = lang_identifier
|
||||||
#iden=`python -c "import sys; print open('language_$i','r').readlines()[1].strip()[2:]"`
|
lang_identifier = lang_identifier[lang_identifier.rindex('(')+1:lang_identifier.rindex(')')]
|
||||||
#mv "language_$i" po/$iden.po
|
print first_line
|
||||||
#mkdir -p $iden/LC_MESSAGES/
|
except:
|
||||||
#msgfmt --output-file=$iden/LC_MESSAGES/wicd.mo po/$iden.po
|
print >> sys.stderr, 'error downloading language %s' % id
|
||||||
lang_identifier = open(pofile,'r').readlines()[0].strip()
|
else:
|
||||||
lang_identifier = lang_identifier[lang_identifier.rindex('(')+1:lang_identifier.rindex(')')]
|
shutil.move(pofile, lang_identifier+'.po')
|
||||||
shutil.move(pofile, lang_identifier+'.po')
|
os.makedirs('translations/'+lang_identifier+'/LC_MESSAGES')
|
||||||
print 'Got',lang_identifier
|
os.system('msgfmt --output-file=translations/' + lang_identifier +
|
||||||
os.makedirs('translations/'+lang_identifier+'/LC_MESSAGES')
|
'/LC_MESSAGES/wicd.mo ' + lang_identifier + '.po')
|
||||||
os.system('msgfmt --output-file=translations/' + lang_identifier +
|
os.remove(lang_identifier+'.po')
|
||||||
'/LC_MESSAGES/wicd.mo ' + lang_identifier + '.po')
|
|
||||||
os.remove(lang_identifier+'.po')
|
|
||||||
|
|
||||||
|
|
||||||
class uninstall(Command):
|
class uninstall(Command):
|
||||||
|
|||||||
Reference in New Issue
Block a user