- Timestamp:
- Nov 14, 2007 4:55:32 AM (13 years ago)
- Location:
- branches/testScripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/testScripts/NBlogMessages.py
r746 r769 11 11 execfile('NBuserParameters.py') 12 12 13 #TODO: one could open the logfile once in the beginning, set it to sys.stdout, flush after each message, and close it finally14 15 13 LOG_MESSAGES='' 16 14 FULL_LOG_MESSAGES='' 15 logfile='' 17 16 18 17 def clearMessages(): … … 33 32 return retVal 34 33 34 def openLogFile(): 35 global logfile 36 logfile=open(NIGHTLY_BUILD_ROOT_DIR+'/'+LOGFILE, 'a') 37 38 def closeLogFile(): 39 global logfile 40 logfile.close() 35 41 36 42 #------------------------------------------------------------------------ … … 45 51 print logMsg 46 52 if len(LOGFILE) > 0 and not LOGFILE.isspace() : 47 logfile=open(NIGHTLY_BUILD_ROOT_DIR+'/'+LOGFILE, 'a')53 global logfile 48 54 logfile.write(logMsg+'\n') 49 # logfile.flush() 50 logfile.close() 55 logfile.flush() -
branches/testScripts/nightlyBuild.py
r750 r769 41 41 os.makedirs(NIGHTLY_BUILD_ROOT_DIR) 42 42 os.chdir( NIGHTLY_BUILD_ROOT_DIR) 43 44 #------------------------------------------------------------------------ 45 # If needed open the logfile 46 #------------------------------------------------------------------------ 47 48 if len(LOGFILE) > 0 and not LOGFILE.isspace() : 49 NBlogMessages.openLogFile() 43 50 44 51 #------------------------------------------------------------------------ … … 254 261 NBemail.send(toAddrs,subject,NBlogMessages.getAllMessages()) 255 262 263 #------------------------------------------------------------------------ 264 # If needed close the logfile 265 #------------------------------------------------------------------------ 266 267 if len(LOGFILE) > 0 and not LOGFILE.isspace() : 268 NBlogMessages.closeLogFile() 269 256 270 sys.exit(0) 257 271
Note: See TracChangeset
for help on using the changeset viewer.