aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2009-04-29 23:18:52 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2009-04-29 23:18:52 +0000
commitf0f3997bc390efbf18b8802e17ce652bd03973f5 (patch)
tree126b0d23ae84f89d5c351071ec70b5649878b9a4
parent84773cf8189fa997751fc967a738126af18683e9 (diff)
added code to upload the log to the autobuild site via rsync
svn path=/trunk/; revision=11203
-rwxr-xr-xscripts/load_every_help.py31
1 files changed, 27 insertions, 4 deletions
diff --git a/scripts/load_every_help.py b/scripts/load_every_help.py
index 0b6a51e6..ef745bfe 100755
--- a/scripts/load_every_help.py
+++ b/scripts/load_every_help.py
@@ -10,7 +10,7 @@ except IndexError:
bindir = pdrootdir + '/bin'
-docdir = pdrootdir + '/doc/5.reference/maxlib'
+docdir = pdrootdir + '/doc'
pdexe = bindir + '/pd'
pdsendexe = bindir + '/pdsend'
@@ -121,19 +121,42 @@ for root, dirs, files in os.walk(docdir):
# for line in patchoutput:
# print '--' + line + '--'
-date = time.strftime('20%y-%m-%d_%H.%M.%S', time.localtime(time.time()))
+now = time.localtime(time.time())
+date = time.strftime('20%y-%m-%d', now)
+datestamp = time.strftime('20%y-%m-%d_%H.%M.%S', now)
-outputfile = '/tmp/load_every_help-' + date + '.log'
+outputfilename = 'load_every_help-' + datestamp + '.log'
+outputfile = '/tmp/' + outputfilename
fd = open(outputfile, 'w')
fd.writelines(logoutput)
fd.close()
+
+# make the email report
fromaddr = 'pd@pdlab.idmi.poly.edu'
toaddr = 'hans@at.or.at'
mailoutput = []
mailoutput.append('From: ' + fromaddr + '\n')
mailoutput.append('To: ' + toaddr + '\n')
-mailoutput.append('Subject: load_every_help ' + date + '\n')
+mailoutput.append('Subject: load_every_help ' + datestamp + '\n\n\n')
+mailoutput.append('______________________________________________________________________\n\n')
+mailoutput.append('Complete log:\n')
+mailoutput.append('http://autobuild.puredata.info/auto-build/' + date + '/'
+ + outputfilename + '\n')
+
+
+# upload the log file to the autobuild website
+rsyncfile = 'rsync://128.238.56.50/upload/' + date + '/' + outputfilename
+try:
+ p = subprocess.Popen(['rsync', '-ax', outputfilename, rsyncfile],
+ stdout=subprocess.PIPE, stderr=subprocess.STDOUT).wait()
+except:
+ mailoutput.append('rsync upload of the log failed!\n')
+ mailoutput.append(''.join(p.stdout.readlines()))
+
+
+
+mailoutput.append('______________________________________________________________________\n\n')
server = smtplib.SMTP('in1.smtp.messagingengine.com')
server.sendmail(fromaddr, toaddr, ''.join(mailoutput + logoutput))
server.quit()