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/lib/processmanager.py

    r1464 r1483  
    121121    # Use the unicode rightward double arrow as a delimiter 
    122122    arrow = u"\u21d2 " 
     123    started = _("Started %s on") 
     124    cwd = _("cwd = ") 
     125    exit = _("exit code = %s") 
     126    finished = _("Finished %s on") 
    123127     
    124128    def __init__(self, cmd, working_dir, job_output): 
     
    133137        self.exit_code = 0 
    134138     
     139    @classmethod 
     140    def matchCwd(cls, line): 
     141        """Evaluate if the line contains an embedded working directory specifier 
     142         
     143        """ 
     144        if line.startswith(cls.arrow): 
     145            start = len(cls.arrow) 
     146            #dprint(line[start:]) 
     147            if line[start:].startswith(_(cls.cwd)): 
     148                cwd = line[start + len(cls.cwd):].strip() 
     149                return cwd 
     150        return "" 
     151     
    135152    def getStartMessage(self): 
    136         return self.arrow + _("Started %s on %s") % (self.cmd, time.asctime(time.localtime(time.time()))) + "\n" 
     153        return "%s%s %s\n%s%s%s\n" % (self.arrow, self.started % self.cmd, time.asctime(time.localtime(time.time())), self.arrow, self.cwd, self.working_dir) 
    137154 
    138155    def getFinishMessage(self): 
    139         return self.arrow + _("exit code = %s") % self.exit_code + "\n" + self.arrow + _("Finished %s on %s") % (self.cmd, time.asctime(time.localtime(time.time()))) + "\n" 
     156        return "%s%s\n%s%s %s" % (self.arrow, self.exit % self.exit_code, self.arrow, self.finished % self.cmd, time.asctime(time.localtime(time.time()))) 
    140157 
    141158    def run(self, text=""):