diff --git a/compile-guide.py b/compile-guide.py index 13fc672..3f50d9f 100755 --- a/compile-guide.py +++ b/compile-guide.py @@ -1,29 +1,29 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # usage: compile-guide.py import sys import configparser, os import re p = re.compile(ur']*)>') config = configparser.ConfigParser() config.readfp(open(sys.argv[2],'r')) enconfig = configparser.ConfigParser() enconfig.readfp(open(sys.argv[1],'r')) for identifier, string in config.items("messages"): if len(string) == 0: string = enconfig.get("messages", identifier) print 'xxxxxxSEPARATORBEGINxxxxxx' print "'''"+string+"'''" for line in open("guide/"+sys.argv[3]+'/'+identifier+".txt").readlines(): raw_line = line.strip() for match in re.findall(p, raw_line): raw_line = raw_line.replace('', config.get("messages", match)) print raw_line print 'xxxxxxSEPARATORENDxxxxxx' diff --git a/compile.py b/compile.py index c210a2c..f75ee03 100755 --- a/compile.py +++ b/compile.py @@ -1,22 +1,22 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 import sys import configparser, os config = configparser.ConfigParser() config.readfp(open(sys.argv[2],'r')) enconfig = configparser.ConfigParser() enconfig.readfp(open(sys.argv[1],'r')) for identifier, string in config.items("messages"): if len(string) == 0: string = enconfig.get("messages", identifier) out = "
" + string out += "
" print out # outarr.append(out) # outfile = open('mediawiki/'+f+'.mw', 'w') # outfile.write('\n'.join(outarr)+'\n') diff --git a/scripts/update-manual.sh b/scripts/update-manual.sh index bf473b4..ce7356d 100755 --- a/scripts/update-manual.sh +++ b/scripts/update-manual.sh @@ -1,7 +1,7 @@ #!/bin/bash LANG="en" for L in $LANG; do cp ../guide/compiled/$L.mw dict.txt - python pwb.py pagefromfile -begin:xxxxxxSEPARATORBEGINxxxxxx -end:xxxxxxSEPARATORENDxxxxxx -notitle -force -lang:$L + python2 pwb.py pagefromfile -begin:xxxxxxSEPARATORBEGINxxxxxx -end:xxxxxxSEPARATORENDxxxxxx -notitle -force -lang:$L done