Show
Ignore:
Timestamp:
07/06/08 16:09:42 (5 months ago)
Author:
rob
Message:

Fixed #484: Added RunFilter? command to run an arbitary program using current buffer as input

Files:
1 modified

Legend:

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

    r1451 r1459  
    2121        BoolParam('show', False), 
    2222        BoolParam('always_scroll', False), 
    23         StrParam('filename_match_regex', "  File \"(.+)\", line ([0-9]+)", 'Regular expression used to match pathnames in the output'), 
     23        StrParam('filename_match_regex', "^  File \"(.+)\", line ([0-9]+)", 'Regular expression used to match pathnames in the output'), 
    2424        ) 
    2525 
     
    3232         
    3333        self.filere = re.compile(self.classprefs.filename_match_regex) 
     34        self.stdre = re.compile("^((?:[a-zA-Z]:)?.+):([0-9]+):") 
    3435 
    3536    def addMessage(self, text): 
     
    5758        self.scanForFilenames() 
    5859     
     60    def matchLine(self, text, i=0): 
     61        match = self.filere.search(text, i) 
     62        if match: 
     63            return match 
     64        match = self.stdre.search(text, i) 
     65        if match: 
     66            return match 
     67        return None 
     68     
    5969    def scanForFilenames(self): 
    6070        if not hasattr(self, 'last_matched_filename'): 
     
    6777        i = 0 
    6878        while i < len(text): 
    69             match = self.filere.search(text, i) 
     79            match = self.matchLine(text, i) 
    7080            if not match: 
    7181                break 
     
    8797            text = self.GetLine(line) 
    8898            #dprint("text=%s" % text) 
    89             match = self.filere.search(text) 
     99            match = self.matchLine(text) 
    90100            if match: 
    91101                filename = match.group(1)