Changeset 1478
- Timestamp:
- 07/09/08 16:10:31 (2 months ago)
- Location:
- trunk/peppy
- Files:
-
- 2 modified
-
major.py (modified) (3 diffs)
-
plugins/python_mode.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/peppy/major.py
r1470 r1478 1010 1010 script, self.getScriptArgs()) 1011 1011 else: 1012 mode = os.stat(script)[stat.ST_MODE] | stat.S_IXUSR1013 os.chmod(script, mode)1014 1012 # Rather than calling the script directly, simulate how the 1013 # operating system uses the bangpath by calling the bangpath 1014 # program with the path to the script supplied as the argument 1015 1015 script = script.replace(' ', '\ ') 1016 cmd = "%s %s " % (script, self.getScriptArgs())1016 cmd = "%s %s %s" % (bangpath, script, self.getScriptArgs()) 1017 1017 else: 1018 1018 interpreter = self.classprefs.interpreter_exe … … 1027 1027 cmd = "%s %s %s %s" % (interpreter, self.getInterpreterArgs(), 1028 1028 script, self.getScriptArgs()) 1029 dprint(cmd)1029 #dprint(cmd) 1030 1030 return cmd 1031 1032 def bangpathModificationHook(self, path): 1033 """Hook method to modify the bang path as read from the first line in 1034 the script. 1035 1036 Note that the passed-in string will have already had the "#!" characters 1037 stripped off, so only the pathname and arguments will exist. 1038 """ 1039 return path 1031 1040 1032 1041 def startInterpreter(self, argstring=None): … … 1043 1052 first = self.GetLine(0) 1044 1053 if first.startswith("#!"): 1045 bangpath = first[2:]1054 bangpath = self.bangpathModificationHook(first[2:].rstrip()) 1046 1055 1047 1056 msg = None -
trunk/peppy/plugins/python_mode.py
r1317 r1478 234 234 235 235 autoindent = PythonAutoindent() 236 237 def bangpathModificationHook(self, path): 238 """Make sure the '-u' flag is included in the python argument""" 239 if '-u' not in path: 240 path += " -u" 241 self.dprint(path) 242 return path 236 243 237 244 def findParagraphStart(self, linenum, info):
