Show
Ignore:
Timestamp:
07/10/08 18:14:45 (4 months ago)
Author:
rob
Message:

Added build, run, and stop project commands
* changed output log to search upwards in the history looking for working directories when double clicking on a grep-like line
* added i18n text for process start/finish messages

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/peppy/plugins/error_log.py

    r1459 r1483  
    1616from peppy.sidebar import * 
    1717from peppy.minor import * 
     18from peppy.lib.processmanager import Job 
    1819 
    1920class LoggingSTC(PeppySTC, ClassPrefs, debugmixin): 
     
    8889            #sys.stdout.write("match ends at %d" % i) 
    8990            self.last_matched_filename = pos + i 
     91     
     92    def findAbsolutePath(self, line): 
     93        """If the filename specified on the line is a relative path, search 
     94        upwards in the stc to locate a cwd specifier. 
     95         
     96        """ 
     97        while line > 0: 
     98            line -= 1 
     99            text = self.GetLine(line) 
     100            if text.startswith(Job.arrow): 
     101                #dprint("Found a candidate at %d: %s" % (line, text)) 
     102                cwd = Job.matchCwd(text) 
     103                if cwd is None: 
     104                    return "" 
     105                elif cwd: 
     106                    return cwd 
     107        return "" 
    90108 
    91109    def OnDoubleClick(self, evt): 
     
    100118            if match: 
    101119                filename = match.group(1) 
     120                if not filename.startswith("/"): 
     121                    path = self.findAbsolutePath(line) 
     122                    filename = os.path.join(path, filename) 
    102123                line = match.group(2) 
    103124                self.open("%s#%s" % (filename, line))