gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject cvs commit: gump/python/gump/document/xdocs documenter.py
Date Thu, 27 May 2004 14:35:28 GMT
ajack       2004/05/27 07:35:28

  Modified:    .        gumpy.py
               python/gump/utils __init__.py
               python/gump/document/xdocs documenter.py
  Log:
  1) Added runlog
  2) Modified 'run details' page to show start and end date/time
  3) Re-organized 'run details' page to three sections
  
  Revision  Changes    Path
  1.37      +39 -6     gump/gumpy.py
  
  Index: gumpy.py
  ===================================================================
  RCS file: /home/cvs/gump/gumpy.py,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- gumpy.py	25 May 2004 14:15:20 -0000	1.36
  +++ gumpy.py	27 May 2004 14:35:28 -0000	1.37
  @@ -41,7 +41,7 @@
   
   LINE=' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GUMP'
   
  -GUMPY_VERSION='2.0.2-alpha-0002'
  +GUMPY_VERSION='2.0.2-alpha-0003'
   
   def ignoreHangup(signum):
       pass
  @@ -133,6 +133,27 @@
           
       except Exception, details:
           print 'Failed to send mail: ' + str(details)
  +        
  +def writeRunLogEntry(entry):
  +    # Enable a run log
  +    runlogFileName='gumpy_runlog.txt'
  +    runlogFile=os.path.abspath(runlogFileName)
  +    runlog=None
  +    try:
  +        runlog=open(runlogFile,'a',0) # Unbuffered...
  +        try:
  +            runlog.write(time.strftime('%d %b %y %H:%M:%S'))
  +            runlog.write(' : ')
  +            runlog.write(`os.getpid()`)
  +            runlog.write(' : ')
  +            runlog.write(entry)
  +            runlog.write('\n')
  +        except Exception, details:
  +            print 'Failed to write to runlog : ' + str(details)
  +    finally:
  +        if runlog:
  +            runlog.close()
  +    
   
               
   def establishLock(lockFile):
  @@ -157,6 +178,8 @@
           lock=open(lockFile,'w')
               
       if failed:
  +        writeRunLogEntry('False Start. The lock file [%s] exists%s' % (lockFile, info))
  +        
           print """The lock file [%s] exists%s. 
   Either Gump is still running, or it terminated very abnormally.    
   Please resolve this (waiting or removing the lock file) before retrying.
  @@ -222,7 +245,11 @@
   
   def tailFileToString(file,lines,eol=None,marker=None):
       return "".join(tailFile(file,lines,eol,marker))
  -    
  +
  +
  +# Starting up...
  +writeRunLogEntry('Gump Start-up. Arguments [%s]' % sys.argv)
  +
   # Allow a lock    
   lockFile=os.path.abspath('gumpy.lock')
   lock=establishLock(lockFile)        
  @@ -241,8 +268,6 @@
   logFile=os.path.abspath(logFileName)
   log=open(logFile,'w',0) # Unbuffered...
   
  -result=0
  -
   hostname='Unknown'
   workspaceName='Unknown'
           
  @@ -254,6 +279,10 @@
   logdir=None
           
   args=sys.argv
  +result=0
  +cvsExit = -1
  +integrationExit = -1
  +        
   try:
   
       try:
  @@ -262,7 +291,8 @@
           hostname = socket.gethostname()
   
           log.write('- GUMP run on host   : ' + hostname + '\n')
  -        log.write('- GUMP run @         : ' + time.strftime('%d %b %y %H:%M:%S', time.gmtime())
+ '\n')
  +        log.write('- GUMP run @         : ' + time.strftime('%d %b %y %H:%M:%S', time.localtime())
+ '\n')
  +        log.write('- GUMP run @  UTC    : ' + time.strftime('%d %b %y %H:%M:%S', time.gmtime())
+ '\n')
           log.write('- GUMP run by Python : ' + `sys.version` + '\n')
           log.write('- GUMP run by Gumpy  : ' + GUMPY_VERSION + '\n')
           log.write('- GUMP run on OS     : ' + `os.name` + '\n')
  @@ -344,7 +374,6 @@
           #
           # Update Gump from CVS
           #    
  -        cvsExit = 0
           if not os.environ.has_key('GUMP_NO_CVS_UPDATE'):
               cvsroot=':pserver:anoncvs@cvs.apache.org:/home/cvspublic'
               os.environ['CVSROOT']=cvsroot
  @@ -352,6 +381,7 @@
               cvsExit = runCommand('cvs -q update -dP')
           else:
               log.write('CVS update skipped per environment setting.\n')
  +            cvsExit=0
           if cvsExit:
               result=1
               
  @@ -468,6 +498,9 @@
               
           else:
               print 'Unable to mail failure report : ' + `[mailserver,mailport,mailto,mailfrom]`
  +            
  +            
  +    writeRunLogEntry('Complete [%s cvs:%s,run:%s]' % (result, cvsExit, integrationExit))
   
   # bye!
   sys.exit(result)
  
  
  
  1.42      +2 -2      gump/python/gump/utils/__init__.py
  
  Index: __init__.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/utils/__init__.py,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- __init__.py	21 May 2004 23:15:06 -0000	1.41
  +++ __init__.py	27 May 2004 14:35:28 -0000	1.42
  @@ -431,8 +431,8 @@
           if marker:
               message=' @ '
               message+=marker
  -        log.debug('Objects Tracked by GC %s : %s' \
  -                % (message,  `tracked`))
  +        #log.debug('Objects Tracked by GC %s : %s' \
  +        #        % (message,  `tracked`))
       except:
           pass  
       return tracked
  
  
  
  1.8       +20 -17    gump/python/gump/document/xdocs/documenter.py
  
  Index: documenter.py
  ===================================================================
  RCS file: /home/cvs/gump/python/gump/document/xdocs/documenter.py,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- documenter.py	26 May 2004 23:31:22 -0000	1.7
  +++ documenter.py	27 May 2004 14:35:28 -0000	1.8
  @@ -359,36 +359,41 @@
           
           definitionSection=document.createSection('Run Details')    
           
  -        definitionSection.createNote('This install runs Python Gump, not Traditional Gump.')

  -        
           definitionTable=definitionSection.createTable()
           definitionTable.createEntry('Gump Run GUID', self.run.getRunGuid())
           definitionTable.createEntry('Gump Run (Hex) GUID', self.run.getRunHexGuid())
           definitionTable.createEntry('Gump Version', setting.version)
  -        definitionTable.createEntry('Java Command', self.run.getEnvironment().javaCommand)
           definitionTable.createEntry('Python', str(sys.version))
           definitionTable.createEntry('Operating System (Name)', str(os.name))
  -        definitionTable.createEntry('@@DATE@@', str(default.date))
  -        definitionTable.createEntry('Start Date/Time (UTC)', self.workspace.getStartDateTimeUtc())
  -        definitionTable.createEntry('Start Date/Time', self.workspace.getStartDateTime())
  -        definitionTable.createEntry('Timezone', self.workspace.timezone)
  -
  -        javaproperties=self.run.getEnvironment().getJavaProperties()
  -        for name in ['java.vendor', 'java.version', 'os.name', 'os.arch', 'os.version']:
  -            if name in javaproperties:
  -                definitionTable.createEntry(name, javaproperties[name])	  
  -
  +        
           tracked=inspectGarbageCollection()
           if tracked:
               definitionTable.createEntry('Garbage Collector Tracked', tracked)    
               
           rssSyndRow=definitionTable.createRow()
  -        rssSyndRow.createData('Syndication')
  +        rssSyndRow.createData().createStrong('Syndication')
           rssSyndRow.createData().createFork('rss.xml','RSS')
           atomSyndRow=definitionTable.createRow()
  -        atomSyndRow.createData('Syndication')
  +        atomSyndRow.createData().createStrong('Syndication')
           atomSyndRow.createData().createFork('atom.xml','Atom')
                   
  +        dtSection=document.createSection('Dates/Times')            
  +        dtTable=dtSection.createTable()        
  +        dtTable.createEntry('@@DATE@@', str(default.date))
  +        dtTable.createEntry('Start Date/Time (UTC)', self.workspace.getStartDateTimeUtc())
  +        dtTable.createEntry('End Date/Time (UTC)', self.workspace.getEndDateTimeUtc())
  +        dtTable.createEntry('Timezone', self.workspace.timezone)
  +        dtTable.createEntry('Start Date/Time', self.workspace.getStartDateTime())
  +        dtTable.createEntry('End Date/Time', self.workspace.getEndDateTime())
  +
  +        javaSection=document.createSection('Java Information')            
  +        javaTable=javaSection.createTable()
  +        javaTable.createEntry('Java Command', self.run.getEnvironment().javaCommand)
  +        javaproperties=self.run.getEnvironment().getJavaProperties()
  +        for name in ['java.vendor', 'java.version', 'os.name', 'os.arch', 'os.version']:
  +            if name in javaproperties:
  +                javaTable.createEntry(name, javaproperties[name])	  
  +
           if not self.gumpSet.isFull():
               notice=definitionSection.createWarning()
               
  @@ -405,11 +410,9 @@
                   notice.createText(project.name)
                   notice.createText(' ')
                               
  -        
           self.documentSummary(document,self.workspace.getProjectSummary())        
           self.documentAnnotations(document,self.run)
       
  -     
           document.serialize()    
           document=None
           
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscribe@gump.apache.org
For additional commands, e-mail: general-help@gump.apache.org


Mime
View raw message