Re: [Zope] forcing all pythonscripts to recompile.
"Norman Khine" wrote you need to open the actual script and save it. i don't think there is a simpler way, although, you may write a python script, which will open the files and then save it, but you are on your own here;^)
Given that this is dozens of scripts, and that you can't even use 'Find' to find them all (since 'Find' won't traverse into ZClasses) this is a pretty unpleasant task. It also means that the Last Changed date on all scripts will be reset to today - not good if you use the last changed at all when using the mgmt interface. Anthony
Anthony Baxter wrote:
"Norman Khine" wrote
you need to open the actual script and save it. i don't think there is a simpler way, although, you may write a python script, which will open the files and then save it, but you are on your own here;^)
Given that this is dozens of scripts, and that you can't even use 'Find' to find them all (since 'Find' won't traverse into ZClasses) this is a pretty unpleasant task. It also means that the Last Changed date on all scripts will be reset to today - not good if you use the last changed at all when using the mgmt interface.
I've used the following external method to recompile all my PythonScripts. def recompile_ps(self): metatype='Script (Python)' for name,script in self.ZopeFind(self, search_sub=1, obj_metatypes=[metatype]): print "recompiling",name script.ZPythonScript_edit( script._params, script._body ) return "OK" -- Steve Alexander Software Engineer Cat-Box limited
"Norman Khine" wrote you need to open the actual script and save it. i don't think there is a simpler way, although, you may write a python script, which will open the files and then save it, but you are on your own here;^)
Given that this is dozens of scripts, and that you can't even use 'Find' to find them all (since 'Find' won't traverse into ZClasses) this is a pretty unpleasant task. It also means that the Last Changed date on all scripts will be reset to today - not good if you use the last changed at all when using the mgmt interface.
Today or tomorrow? Whenever! You're going to need to click them with the mouse anyways so, go ahead and write a script that saves us all mouse clicks :) just: --- mouseclicks_pys() --- for object in context.objectValues(): # is a folderish container object? if object.isPrinicpiaFolderish: # step inside object.mouseclicks_pys() elif object.meta_type="Script Python": object.manage_clickSaveButton() someting like that
Anthony Baxter writes:
"Norman Khine" wrote you need to open the actual script and save it. i don't think there is a simpler way, although, you may write a python script, which will open the files and then save it, but you are on your own here;^)
Given that this is dozens of scripts, and that you can't even use 'Find' to find them all (since 'Find' won't traverse into ZClasses) this is a pretty unpleasant task. It also means that the Last Changed date on all scripts will be reset to today - not good if you use the last changed at all when using the mgmt interface. I would change the code...
If Zope is able to generate the log entry, it should (at that place) also be able to automatically recompile the script. I do not yet have the problem, though, as I did not yet switch to Zope 2.4. Dieter
participants (4)
-
Anthony Baxter -
Dieter Maurer -
Peter Bengtsson -
Steve Alexander