Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
d15e2eb4
Commit
d15e2eb4
authored
Dec 11, 2000
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
untabified
parent
353161fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
lib/python/Products/PythonScripts/zbytecodehacks/VSExec.py
lib/python/Products/PythonScripts/zbytecodehacks/VSExec.py
+9
-9
lib/python/Products/PythonScripts/zbytecodehacks/code_editor.py
...thon/Products/PythonScripts/zbytecodehacks/code_editor.py
+4
-4
No files found.
lib/python/Products/PythonScripts/zbytecodehacks/VSExec.py
View file @
d15e2eb4
...
@@ -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
),
lib/python/Products/PythonScripts/zbytecodehacks/code_editor.py
View file @
d15e2eb4
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment