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
f84b5394
Commit
f84b5394
authored
Feb 07, 2002
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge fix from 2.5 branch
parent
b3c9e0f1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
lib/python/Products/PythonScripts/PythonScript.py
lib/python/Products/PythonScripts/PythonScript.py
+14
-3
No files found.
lib/python/Products/PythonScripts/PythonScript.py
View file @
f84b5394
...
...
@@ -17,7 +17,7 @@ This product provides support for Script objects containing restricted
Python code.
"""
__version__
=
'$Revision: 1.3
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.3
9
$'
[
11
:
-
2
]
import
sys
,
os
,
traceback
,
re
,
marshal
from
Globals
import
DTMLFile
,
MessageDialog
,
package_home
...
...
@@ -42,6 +42,12 @@ del imp
# This should only be incremented to force recompilation.
Script_magic
=
3
_log_complaint
=
(
'Some of your Scripts have stale code cached. Since Zope cannot'
' use this code, startup will be slightly slower until these Scripts'
' are edited. You can automatically recompile all Scripts that have'
' this problem by visiting /manage_addProduct/PythonScripts/recompile'
' of your server in a browser.'
)
manage_addPythonScriptForm
=
DTMLFile
(
'www/pyScriptAdd'
,
globals
())
_default_file
=
os
.
path
.
join
(
package_home
(
globals
()),
...
...
@@ -189,9 +195,14 @@ class PythonScript(Script, Historical, Cacheable):
Script.__setstate__(self, state)
if (getattr(self, '
Python_magic
', None) != Python_magic or
getattr(self, '
Script_magic
', None) != Script_magic):
LOG(self.meta_type, PROBLEM,
'
Object
"%s"
needs
to
be
recompiled
.
' % self.id)
global _log_complaint
if _log_complaint:
LOG(self.meta_type, INFO, _log_complaint)
_log_complaint = 0
# Changes here won'
t
get
saved
,
unless
this
Script
is
edited
.
body
=
self
.
_body
.
rstrip
()
if
body
:
self
.
_body
=
body
+
'
\
n
'
self
.
_compile
()
self
.
_v_change
=
1
elif
self
.
_code
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