ajack 2004/04/16 13:38:12
Modified: python/gump/document documenter.py
python gmp.py
python/gump/core gumpenv.py
Log:
Minor tweaks.
1) Ruper -> Update (name change)
2) Less verbose.
Revision Changes Path
1.15 +3 -3 gump/python/gump/document/documenter.py
Index: documenter.py
===================================================================
RCS file: /home/cvs/gump/python/gump/document/documenter.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- documenter.py 14 Apr 2004 23:06:57 -0000 1.14
+++ documenter.py 16 Apr 2004 20:38:11 -0000 1.15
@@ -37,7 +37,7 @@
def prepare(self,run):
if not hasattr(self,'prepareRun'): return
if not callable(self.prepareRun): return
- log.info('Prepare to document run using [' + `self` + ']')
+ log.debug('Prepare to document run using [' + `self` + ']')
self.prepareRun(run)
#
@@ -46,7 +46,7 @@
def entity(self,entity,run):
if not hasattr(self,'documentEntity'): return
if not callable(self.documentEntity): return
- log.info('Document entity [' + `entity` + '] using [' + `self` + ']')
+ log.debug('Document entity [' + `entity` + '] using [' + `self` + ']')
self.documentEntity(entity,run)
#
@@ -61,7 +61,7 @@
raise RuntimeError, \
'Class [' + `self.__class__` + '] needs a callable
documentRun(self,run)'
- log.info('Document run using [' + `self` + ']')
+ log.debug('Document run using [' + `self` + ']')
self.documentRun(run)
1.5 +6 -48 gump/python/gmp.py
Index: gmp.py
===================================================================
RCS file: /home/cvs/gump/python/gmp.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- gmp.py 14 Apr 2004 22:12:58 -0000 1.4
+++ gmp.py 16 Apr 2004 20:38:11 -0000 1.5
@@ -35,12 +35,6 @@
import StringIO
from xml.dom import minidom
-def ignoreHangup(signum):
- pass
-
-def glog(descr, what):
- print '- GUMP ' + descr + ' :['+ what + ']'
-
def runCommand(command,args='',dir=None,outputFile=None):
""" Run a command, and check the result... """
@@ -50,20 +44,16 @@
originalCWD=os.getcwd()
cwdpath=os.path.abspath(dir)
try:
- glog('Executing with CWD', dir )
if not os.path.exists(cwdpath): os.makedirs(dir)
os.chdir(cwdpath)
except Exception, details :
# Log the problem and re-raise
- glog('Failed to create/change CWD', cwdpath)
- glog('Details', str(details) )
return 0
try:
fullCommand = command + ' ' + args
- glog('Execute', fullCommand)
-
+
#
# Execute Command & Calculate Exit Code
#
@@ -84,8 +74,6 @@
else:
exit_code=systemReturn
- glog('Exit Code', `exit_code`)
-
finally:
if originalCWD: os.chdir(originalCWD)
@@ -94,11 +82,6 @@
def callGmpCommand(ws,command,projects,iargs):
iargs+=' --text'
-
- glog('ws',ws)
- glog('command',command)
- glog('projects',projects)
- glog('args',iargs)
#
# Actually run the Gump command
@@ -106,9 +89,9 @@
command=os.path.join(os.environ['GUMP_HOME'],'python/gump/'+command+'.py')
exitValue = runCommand('python '+command+' -w '+ws+' '+projects, iargs,
'python')
- if exitValue:
- result=1
-
+
+ return exitValue
+
if not os.environ.has_key('GUMP_HOME'):
print 'Please set GUMP_HOME to where Gump is installed.'
@@ -126,15 +109,6 @@
""" % lockFile
sys.exit(1)
-# Set the signal handler to ignore hangups
-try:
- # Not supported by all OSs
- # :TODO: Does the variable signal.SIG_HUP even exist? Test
- # this code on Linux w/o the try/except.
- signal.signal(signal.SIG_HUP, ignoreHangup)
-except:
- pass
-
# Write this PID into a lock file
lock=open(lockFile,'w')
lock.write(`os.getpid()`)
@@ -150,16 +124,6 @@
# Process Environment
hostname = socket.gethostname()
- glog('run on host ',hostname)
- glog('run @ ',time.strftime('%d %b %y %H:%M:%S', time.gmtime()))
- glog('run by Python',`sys.version`)
- glog('run on OS ',`os.name`)
- glog('run in env ','see below')
-
- for envkey in os.environ.keys():
- envval=os.environ[envkey]
- glog(' ' + envkey, envval)
-
# The path of this command
gmpPath = os.path.abspath(args[0])
del args[0]
@@ -211,11 +175,6 @@
logdir=wsw.getAttribute('logdir') or os.path.join(basePath,'log')
# Finish parsing
ws.unlink()
-
- glog('base directory', baseDir)
- glog('base path ',str(basePath))
- if logurl:
- glog('log is @ ',logurl)
#
# Add Gump to Python Path...
@@ -225,10 +184,9 @@
pythonPath=os.environ['PYTHONPATH']
pythonPath+=os.pathsep
pythonPath+=str(os.path.abspath(os.path.join(os.environ['GUMP_HOME'],'python')))
- glog('PYTHONPATH', pythonPath)
os.environ['PYTHONPATH']=pythonPath
- callGmpCommand(workspacePath,command,projectsExpr,iargs)
+ result=callGmpCommand(workspacePath,command,projectsExpr,iargs)
except KeyboardInterrupt:
print 'Terminated by user interrupt...'
1.2 +5 -5 gump/python/gump/core/gumpenv.py
Index: gumpenv.py
===================================================================
RCS file: /home/cvs/gump/python/gump/core/gumpenv.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- gumpenv.py 16 Apr 2004 17:28:41 -0000 1.1
+++ gumpenv.py 16 Apr 2004 20:38:12 -0000 1.2
@@ -54,7 +54,7 @@
#
self.noForrest=0
self.noMaven=0
- self.noRuper=0
+ self.noUpdate=0
self.noTimeout=0
self.noSvn=0
self.noCvs=0
@@ -157,10 +157,10 @@
else:
setting.timeoutCommand=1
- if not self.noRuper and \
- not self.checkExecutable('ruper','-version',0,0,'check_ruper'):
- self.noRuper=1
- self.addWarning('"ruper" command not found, no package downloads')
+ if not self.noUpdate and \
+ not self.checkExecutable('python
update.py','-version',0,0,'check_depot_update'):
+ self.noUpdate=1
+ self.addWarning('"update.py" command not found, no package downloads')
if not self.noMaven and \
not self.checkExecutable('maven','--version',0,0,'check_maven'):
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]