Commit 0ce64fb3 authored by Daniel Brown's avatar Daniel Brown
Browse files

fixing somethings to get working on python 2.6 and git

parent 2bfc6dc0
import subprocess as sub
import os
GIT_BIN = "c:\\cygwin64\\bin\\git"
GIT_BIN = "/usr/bin/git"
class RunException(Exception):
def __init__(self, returncode, args, err, out):
......@@ -23,13 +23,13 @@ def git(args):
print os.getcwd()
p = sub.Popen(cmd, stdout=sub.PIPE, stderr=sub.PIPE)
p = sub.Popen(cmd, stdout=sub.PIPE, stderr=sub.PIPE,shell=True)
out, err = p.communicate()
if p.returncode != 0:
print "STDERR: " + err
print "STDOUT: " + err
raise RunException(p.returncode, args, err, out)
raise RunException(p.poll(), args, err, out)
return [out, err]
......@@ -3,7 +3,7 @@ import sys
from flask import Flask
from pykat.testing import utils
def start(instance_path,port=5000, debug=False):
def start(instance_path,port=5000, debug=True, ip="0.0.0.0"):
global app
print "starting web server..."
......@@ -21,27 +21,28 @@ def start(instance_path,port=5000, debug=False):
from pykat.testing.web import app
if(app.instance_path!=instance_path):
print app.instance_path, instance_path
raise Exception("Instance path of Flask app didn't match the requested value")
# load up the actual interface code
import pykat.testing.web.web_interface
# need local copy of src
if not os.path.exists("./finesse_src"):
if not os.path.exists(os.path.join(app.instance_path,"finesse_src")):
print "finesse src folder didn't exist, cloning now..."
utils.git("clone git://gitmaster.atlas.aei.uni-hannover.de/finesse/src.git finesse_src")
utils.git(["clone","git://gitmaster.atlas.aei.uni-hannover.de/finesse/src.git","finesse_src"])
else:
os.chdir(os.path.join(app.instance_path,"finesse_src"))
# get the latest version for logs etc.
utils.git("pull")
# need local copy of test
if not os.path.exists("./finesse_test"):
if not os.path.exists(os.path.join(app.instance_path,"finesse_test")):
print "finesse test folder didn't exist, cloning now..."
utils.git("clone git://gitmaster.atlas.aei.uni-hannover.de/finesse/test.git finesse_test")
utils.git(["clone","git://gitmaster.atlas.aei.uni-hannover.de/finesse/test.git","finesse_test"])
app.secret_key = os.urandom(24)
app.run(debug=debug, port=int(port))
app.run(debug=debug, port=int(port), host=ip)
if __name__ == "__main__":
n = len(sys.argv)
......@@ -71,3 +72,6 @@ start_test_server usage:
start(instance_path, port=port)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment