summaryrefslogtreecommitdiff
path: root/.waf3-1.7.16-0356ded4079f8d9c0828a065ed2fdab1/waflib/fixpy2.py
diff options
context:
space:
mode:
authoryo mama <pepper@scannerjammer.com>2015-01-25 23:46:43 -0800
committeryo mama <pepper@scannerjammer.com>2015-01-25 23:46:43 -0800
commite49ddd41e5549c1c6abab8005edd2e8b18ee0e09 (patch)
tree017a97ce4f17c9a4422e80f56f4e638c629438d4 /.waf3-1.7.16-0356ded4079f8d9c0828a065ed2fdab1/waflib/fixpy2.py
working copy...first push
Diffstat (limited to '.waf3-1.7.16-0356ded4079f8d9c0828a065ed2fdab1/waflib/fixpy2.py')
-rw-r--r--.waf3-1.7.16-0356ded4079f8d9c0828a065ed2fdab1/waflib/fixpy2.py53
1 files changed, 53 insertions, 0 deletions
diff --git a/.waf3-1.7.16-0356ded4079f8d9c0828a065ed2fdab1/waflib/fixpy2.py b/.waf3-1.7.16-0356ded4079f8d9c0828a065ed2fdab1/waflib/fixpy2.py
new file mode 100644
index 0000000..dd058e2
--- /dev/null
+++ b/.waf3-1.7.16-0356ded4079f8d9c0828a065ed2fdab1/waflib/fixpy2.py
@@ -0,0 +1,53 @@
+#! /usr/bin/env python
+# encoding: utf-8
+# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
+
+import os
+all_modifs={}
+def fixdir(dir):
+ global all_modifs
+ for k in all_modifs:
+ for v in all_modifs[k]:
+ modif(os.path.join(dir,'waflib'),k,v)
+def modif(dir,name,fun):
+ if name=='*':
+ lst=[]
+ for y in'. Tools extras'.split():
+ for x in os.listdir(os.path.join(dir,y)):
+ if x.endswith('.py'):
+ lst.append(y+os.sep+x)
+ for x in lst:
+ modif(dir,x,fun)
+ return
+ filename=os.path.join(dir,name)
+ f=open(filename,'r')
+ try:
+ txt=f.read()
+ finally:
+ f.close()
+ txt=fun(txt)
+ f=open(filename,'w')
+ try:
+ f.write(txt)
+ finally:
+ f.close()
+def subst(*k):
+ def do_subst(fun):
+ global all_modifs
+ for x in k:
+ try:
+ all_modifs[x].append(fun)
+ except KeyError:
+ all_modifs[x]=[fun]
+ return fun
+ return do_subst
+@subst('*')
+def r1(code):
+ code=code.replace('as e:',',e:')
+ code=code.replace(".decode(sys.stdout.encoding or 'iso8859-1')",'')
+ code=code.replace('.encode()','')
+ return code
+@subst('Runner.py')
+def r4(code):
+ code=code.replace('next(self.biter)','self.biter.next()')
+ return code