[Zope-CMF] PROBLEM(100) Script (Python) Object "dateMunger"needs to be recompiled.

Chris Withers chrisw@nipltd.com
Fri, 27 Jul 2001 09:53:30 +0100


This is a multi-part message in MIME format.
--------------C6C029FCA62380CF2D3BA25D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Bill Anderson wrote:
> 
> I posted htis a day or so ago (TZ depending).
> So far, you can go to the method's edi tscreen and click save to make it go away for
> that script, but I have yet to find a method of forcing them all to do it, short
> of manually finding and resaving ALL of them. :(

Bill, try this hack^h^h^h^hpatch...

Shane will no doubt explain why it doesn't work ;-)

cheers,

Chris
--------------C6C029FCA62380CF2D3BA25D
Content-Type: text/plain; charset=us-ascii;
 name="PythonScript.py.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="PythonScript.py.patch"

--- E:\Zope\2.4.0b3\lib\python\Products\PythonScripts\PythonScript.py.original	Mon Jul 02 14:13:42 2001
+++ E:\Zope\2.4.0b3\lib\python\Products\PythonScripts\PythonScript.py	Fri Jul 27 09:09:20 2001
@@ -260,9 +260,10 @@
         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)
+            LOG(self.meta_type, INFO,
+                'Object "%s" has been recompiled.' % self.id)
             # Changes here won't get saved, unless this Script is edited.
+            self.write(self.read())
             self._compile()
             self._v_change = 1
         elif self._code is None:

--------------C6C029FCA62380CF2D3BA25D--