[wingide-users] patch for WingDBG to use with plone 4.1

robert rottermann robert at redcor.ch
Fri Mar 4 07:56:42 MST 2011


Hi there,
below an adapted method to be able to debug python scripts when running plone 4.1
it replaces the same method in ScriptDebugging.py
I marked what I changed with:
# robert at redcor.ch added try block for plone 4.1

cheers
robert

     # Now includes the file path
     def FSPythonScript_write(self, text, compile):
         '''
         Parses the source, storing the body, params, title, bindings,
         and source in self.  If compile is set, compiles the
         function.
         '''
         ps = PythonScript(self.id, expandpath(self._filepath))
         ps.write(text)
         if compile:
             # robert at redcor.ch added try block for plone 4.1
             try:
                 ps._makeFunction(1)
                 self._v_f = f = ps._v_f
                 self._v_ft = ps._v_ft     # robert added for plone 4
                 if f is not None:
                     self.func_code = f.func_code
                     self.func_defaults = f.func_defaults
                 else:
                     # There were errors in the compile.
                     # No signature.
                     self.func_code = bad_func_code()
                     self.func_defaults = None
             except TypeError:
                 # changed in zope/plone 4.1
                 ps._makeFunction()
                 self._v_ft = ps._v_ft
                 self.func_code = ps.func_code
                 self.func_defaults = ps.func_defaults
         self._body = ps._body
         self._params = ps._params
         self.title = ps.title
         self._setupBindings(ps.getBindingAssignments().getAssignedNames())
         self._source = ps.read()  # Find out what the script sees.

     savedFSPythonScript_createZODBClone = FSPythonScript._createZODBClone
     savedFSPythonScript_write = FSPythonScript._write



More information about the wingide-users mailing list