[Zope-Checkins] CVS: Zope2 - PythonScript.py:1.35

evan@serenade.digicool.com evan@serenade.digicool.com
Tue, 10 Jul 2001 12:15:50 -0400


Update of /cvs-repository/Zope2/lib/python/Products/PythonScripts
In directory serenade:/home/evan/Zope/trunk/lib/python/Products/PythonScripts

Modified Files:
	PythonScript.py 
Log Message:
Merge changes from 2.4 branch



--- Updated File PythonScript.py in package Zope2 --
--- PythonScript.py	2001/07/02 17:59:52	1.34
+++ PythonScript.py	2001/07/10 16:15:49	1.35
@@ -129,8 +129,9 @@
     if REQUEST is not None:
         file = REQUEST.form.get('file', '')
         if type(file) is not type(''): file = file.read()
-        if file:
-            self._getOb(id).write(file)
+        if not file:
+            file = open(_default_file).read()
+        self._getOb(id).write(file)
         try: u = self.DestinationURL()
         except: u = REQUEST['URL1']
         if submit==" Add and Edit ": u="%s/%s" % (u,quote(id))
@@ -170,7 +171,7 @@
     def __init__(self, id):
         self.id = id
         self.ZBindings_edit(defaultBindings)
-        self._body = open(_default_file).read()
+        self._makeFunction()
 
     security = AccessControl.ClassSecurityInfo()
 
@@ -468,8 +469,7 @@
             if bup:
                 self._setupBindings(bindmap)
 
-            if self._p_changed:
-                self._makeFunction()
+            self._makeFunction()
         except:
             LOG(self.meta_type, ERROR, 'write failed', error=sys.exc_info())
             raise