akmhoque | fa8ee9b | 2014-03-14 09:06:24 -0500 | [diff] [blame^] | 1 | #! /usr/bin/env python |
| 2 | # encoding: utf-8 |
| 3 | # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file |
| 4 | |
| 5 | import os |
| 6 | all_modifs={} |
| 7 | def fixdir(dir): |
| 8 | global all_modifs |
| 9 | for k in all_modifs: |
| 10 | for v in all_modifs[k]: |
| 11 | modif(os.path.join(dir,'waflib'),k,v) |
| 12 | def modif(dir,name,fun): |
| 13 | if name=='*': |
| 14 | lst=[] |
| 15 | for y in'. Tools extras'.split(): |
| 16 | for x in os.listdir(os.path.join(dir,y)): |
| 17 | if x.endswith('.py'): |
| 18 | lst.append(y+os.sep+x) |
| 19 | for x in lst: |
| 20 | modif(dir,x,fun) |
| 21 | return |
| 22 | filename=os.path.join(dir,name) |
| 23 | f=open(filename,'r') |
| 24 | try: |
| 25 | txt=f.read() |
| 26 | finally: |
| 27 | f.close() |
| 28 | txt=fun(txt) |
| 29 | f=open(filename,'w') |
| 30 | try: |
| 31 | f.write(txt) |
| 32 | finally: |
| 33 | f.close() |
| 34 | def subst(*k): |
| 35 | def do_subst(fun): |
| 36 | global all_modifs |
| 37 | for x in k: |
| 38 | try: |
| 39 | all_modifs[x].append(fun) |
| 40 | except KeyError: |
| 41 | all_modifs[x]=[fun] |
| 42 | return fun |
| 43 | return do_subst |
| 44 | @subst('*') |
| 45 | def r1(code): |
| 46 | code=code.replace(',e:',',e:') |
| 47 | code=code.replace("",'') |
| 48 | code=code.replace('','') |
| 49 | return code |
| 50 | @subst('Runner.py') |
| 51 | def r4(code): |
| 52 | code=code.replace('next(self.biter)','self.biter.next()') |
| 53 | return code |