From 80795164f9c72863f51345249c2e02290abc6090 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sun, 9 Oct 2011 03:29:30 +0000 Subject: made it write to the long file after each patch is run svn path=/trunk/; revision=15549 --- scripts/load_every_help.py | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) (limited to 'scripts/load_every_help.py') diff --git a/scripts/load_every_help.py b/scripts/load_every_help.py index 38de996d..5522b118 100755 --- a/scripts/load_every_help.py +++ b/scripts/load_every_help.py @@ -131,9 +131,21 @@ def remove_ignorelines(list): #---------- main()-like thing ----------# -make_netreceive_patch(netreceive_patch) +now = time.localtime(time.time()) +date = time.strftime('20%y-%m-%d', now) +datestamp = time.strftime('20%y-%m-%d_%H.%M.%S', now) + +outputfilename = 'load_every_help_' + socket.gethostname() + '_' + datestamp + '.log' +outputfile = '/tmp/' + outputfilename +fd = open(outputfile, 'w') +fd.write('load_every_help\n') +fd.write('========================================================================\n') +fd.flush() logoutput = [] + +make_netreceive_patch(netreceive_patch) + docdir = os.path.join(pdrootdir, 'doc') for root, dirs, files in os.walk(docdir): for name in files: @@ -153,27 +165,22 @@ for root, dirs, files in os.walk(docdir): line = p.stdout.readline() m = re.search('EOF on socket', line) if not m and line: - patchoutput.append(line) + patchoutput.append(line) + fd.write(line) else: break patchoutput = remove_ignorelines(patchoutput) if len(patchoutput) > 0: -# print 'found log messages: ' + patch - logoutput.append('\n\n__________________________________________________\n') - logoutput.append('loading: ' + patch + '\n') -# logoutput.append('--------------------------------------------------\n') + header = [] + header.append('\n\n__________________________________________________\n') + header.append('loading: ' + patch + '\n') + logoutput += header + for line in header: + fd.write(line) logoutput += patchoutput -# for line in patchoutput: -# print '--' + line + '--' - -now = time.localtime(time.time()) -date = time.strftime('20%y-%m-%d', now) -datestamp = time.strftime('20%y-%m-%d_%H.%M.%S', now) - -outputfilename = 'load_every_help_' + socket.gethostname() + '_' + datestamp + '.log' -outputfile = '/tmp/' + outputfilename -fd = open(outputfile, 'w') -fd.writelines(logoutput) + for line in patchoutput: + fd.write(line) + fd.flush() fd.close() -- cgit v1.2.1