[Zope-Checkins] CVS: Zope2 - PythonScript.py:1.16.2.7.4.1
evan@serenade.digicool.com
evan@serenade.digicool.com
Mon, 12 Mar 2001 20:44:04 -0500
Update of /cvs-repository/Zope2/lib/python/Products/PythonScripts
In directory serenade:/slab/home/evan/Zope/psfix/lib/python/Products/PythonScripts
Modified Files:
Tag: evan-script_fix-branch
PythonScript.py
Log Message:
Added default content to Scripts, for demonstration purposes.
--- Updated File PythonScript.py in package Zope2 --
--- PythonScript.py 2001/02/09 19:00:12 1.16.2.7
+++ PythonScript.py 2001/03/13 01:43:33 1.16.2.7.4.1
@@ -92,7 +92,7 @@
__version__='$Revision$'[11:-2]
import sys, os, traceback, re
-from Globals import DTMLFile, MessageDialog
+from Globals import DTMLFile, MessageDialog, package_home
import AccessControl, OFS, Guarded
from OFS.SimpleItem import SimpleItem
from DateTime.DateTime import DateTime
@@ -109,6 +109,7 @@
del imp
manage_addPythonScriptForm = DTMLFile('www/pyScriptAdd', globals())
+_default_file = package_home(globals()) + '/www/default.py'
_marker = [] # Create a new marker object
@@ -158,6 +159,11 @@
def __init__(self, id):
self.id = id
self.ZBindings_edit(defaultBindings)
+ try:
+ self.write(open(_default_file).read())
+ except:
+ LOG(self.meta_type, ERROR, 'Error in www/default.py')
+ self.write('')
self._makeFunction(1)
security = AccessControl.ClassSecurityInfo()