Changeset 149
- Timestamp:
- 03/23/06 19:00:10 (6 years ago)
- Files:
-
- 1 modified
-
WingDBG/trunk/ScriptDebugging.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
WingDBG/trunk/ScriptDebugging.py
r91 r149 15 15 Wingware to support debugging of file system scripts running under Zope''' 16 16 17 __version__='1.0. 3'18 19 import sys, marshal17 __version__='1.0.4' 18 19 import os, sys, marshal 20 20 from zLOG import LOG, ERROR 21 21 … … 23 23 from Products.PythonScripts.PythonScript import PythonScript, Python_magic, \ 24 24 Script_magic, _nonempty_line, _first_indent, _nice_bind_names 25 26 # Copy of code from CMFCore utils so we can expand the partial 27 # paths used for products to full path 28 import Products 29 ProductsPath = [ os.path.abspath(ppath) for ppath in Products.__path__ ] 30 def expandpath(p): 31 p = os.path.normpath(p) 32 if os.path.isabs(p): 33 return p 34 35 for ppath in ProductsPath: 36 abs = os.path.join(ppath, p) 37 if os.path.exists(abs): 38 return abs 39 40 # We're hosed 41 return p 25 42 26 43 # Add support for storing a path to the file. … … 36 53 def PythonScript_compile(self): 37 54 38 fp = getattr(self, '_filepath', self.meta_type) 55 fp = getattr(self, '_filepath', None) 56 if fp is not None: 57 fp = expandpath(fp) 58 else: 59 fp = self.meta_type 39 60 bind_names = self.getBindingAssignments().getAssignedNamesInOrder() 40 61 r = self._compiler(self._params, self._body or 'pass', … … 189 210 try: 190 211 from Products.CMFCore.FSPythonScript import FSPythonScript 191 from Products.CMFCore.DirectoryView import expandpath192 212 except ImportError: 193 213 FSPythonScript = None … … 253 273 if CMFPythonScript is not None: 254 274 CMFPythonScript.write = PythonScriptwrite 255 275 256 276 def unpatch(): 257 277 PythonScript.__init__ = savedPythonScript__init__
