Commit d15e2eb4 authored by 's avatar

untabified

parent 353161fd
...@@ -169,13 +169,13 @@ class CodeBlock: ...@@ -169,13 +169,13 @@ class CodeBlock:
self.munge(subcode, depth+1) self.munge(subcode, depth+1)
# Make the current recursion depth accessible # Make the current recursion depth accessible
self.depth = depth self.depth = depth
code = fc.co_code code = fc.co_code
warnings, errors = self.warnings, self.errors warnings, errors = self.warnings, self.errors
# Initialize the Munge objects # Initialize the Munge objects
mungers = [] mungers = []
window = Munge_window(code, 1) window = Munge_window(code, 1)
margs = (self, window, fc) margs = (self, window, fc)
for M in self.Mungers: for M in self.Mungers:
try: try:
mungers.append(apply(M, margs)) mungers.append(apply(M, margs))
except Exception, e: except Exception, e:
...@@ -569,15 +569,15 @@ def test(p, c): ...@@ -569,15 +569,15 @@ def test(p, c):
return sb return sb
if __name__ == '__main__': if __name__ == '__main__':
sb = test('x', '''\ sb = test('x', '''\
print x print x
def plus1(x): def plus1(x):
print x+1 print x+1
plus1(x) plus1(x)
return printed''') return printed''')
f = UntupleFunction(sb.t, {}) f = UntupleFunction(sb.t, {})
#from dis import dis #from dis import dis
#dis(f) #dis(f)
print f(2), print f(2),
print f(3), print f(3),
...@@ -14,7 +14,7 @@ from cyclehandle import CycleHandle ...@@ -14,7 +14,7 @@ from cyclehandle import CycleHandle
class CodeString(CycleHandle): class CodeString(CycleHandle):
def __init__(self,cs=None,bytecodes=None): def __init__(self,cs=None,bytecodes=None):
self._set_workers(CodeStringWorker(cs, bytecodes)) self._set_workers(CodeStringWorker(cs, bytecodes))
class CodeStringWorker: class CodeStringWorker:
def __init__(self,cs,bytecodes): def __init__(self,cs,bytecodes):
...@@ -159,7 +159,7 @@ class CodeStringWorker: ...@@ -159,7 +159,7 @@ class CodeStringWorker:
class EditableCode(CycleHandle): class EditableCode(CycleHandle):
def __init__(self,code=None): def __init__(self,code=None):
self._set_workers(EditableCodeWorker(code)) self._set_workers(EditableCodeWorker(code))
class EditableCodeWorker: class EditableCodeWorker:
# bits for co_flags # bits for co_flags
...@@ -276,8 +276,8 @@ class EditableCodeWorker: ...@@ -276,8 +276,8 @@ class EditableCodeWorker:
class Function(CycleHandle): class Function(CycleHandle):
def __init__(self,func=None): def __init__(self,func=None):
self._set_workers(FunctionWorker(func)) self._set_workers(FunctionWorker(func))
class FunctionWorker: class FunctionWorker:
def __init__(self,func): def __init__(self,func):
if func is None: if func is None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment