#!/usr/bin/env python # # Bootstrap for kforge automatic testing. # import os import urllib2 import tempfile scriptName = 'kforge-integrationtest' print "Downloading and executing %s..." % (scriptName) url = 'http://scm.kforge.net/svn/kforge/trunk/bin/%s' % scriptName print "Downloading %s from: %s" % (scriptName, url) request = urllib2.Request(url) agent = urllib2.build_opener() doc = agent.open(request).read() print "Downloaded %s complete." % (scriptName) (fd, filename) = tempfile.mkstemp(prefix=scriptName) print "Saving %s to temporary location: %s" % (scriptName, filename) try: os.write(fd, doc) print "Saved %s OK." % (scriptName) print "Attempting to execute %s...." % (scriptName) os.system('python ' + filename) finally: print "Removing temporary %s '%s'" % (scriptName, filename) os.remove(filename) print "Downloading and executing %s completed." % (scriptName)