Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions fri/server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,27 @@ def upload(dir):
def build(dir):
graphml_file = request.args.get('fetch')
apikey = request.args.get('apikey')
out_dir = request.args.get('outdir')
if(apikey == None):
dirname = secure_filename(dir)
else:
dirname = secure_filename(dir) + "_" + apikey
makestudy_dir = dirname + "/" + graphml_file #for makestudy
dir_path = os.path.abspath(os.path.join(concore_path, graphml_file)) #path for ./build
if(out_dir == None or out_dir == ""):
dir_path = os.path.abspath(os.path.join(concore_path, graphml_file)) #path for ./build
else:
dir_path = os.path.abspath(os.path.join(concore_path, out_dir)) #path for ./build
if not os.path.exists(dir_path):
if(platform.uname()[0]=='Windows'):
proc= call(["makestudy", makestudy_dir], shell=True, cwd=concore_path)
if(out_dir == None or out_dir == ""):
proc= call(["makestudy", makestudy_dir], shell=True, cwd=concore_path)
else:
proc= call(["makestudy", makestudy_dir, out_dir], shell=True, cwd=concore_path)
else:
proc = call(["./makestudy", makestudy_dir], cwd=concore_path)
if(out_dir == None or out_dir == ""):
proc= call(["./makestudy", makestudy_dir], cwd=concore_path)
else:
proc= call(["./makestudy", makestudy_dir, out_dir], cwd=concore_path)
if(proc == 0):
resp = jsonify({'message': 'Directory successfully created'})
resp.status_code = 201
Expand Down
22 changes: 11 additions & 11 deletions fri/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def upload(files):
# # *******

# function to check build
def build(dir, graphml, apikey):
url = "http://127.0.0.1:5000/build/"+dir+"?"+"fetch="+graphml+"&"+"apikey="+apikey
def build(dir, graphml, outdir, apikey):
url = "http://127.0.0.1:5000/build/"+dir+"?"+"fetch="+graphml+"&"+"outdir="+outdir+"&"+"apikey="+apikey
response = requests.request("POST", url)
print(response.text)

Expand Down Expand Up @@ -83,20 +83,20 @@ def download(dir, subDir, fileName , apikey ):

upload(files)
time.sleep(2)
build("test", "sample", "xyz")
build("test", "sample", "sample-anyname", "xyz")
time.sleep(6)
method = input("methods - 1 for debug, 0 for run :")
if method == "1":
debug("sample", "xyz")
debug("sample-anyname", "xyz")
else:
run("sample", "xyz")
run("sample-anyname", "xyz")
time.sleep(2)
stop("sample", "xyz")
stop("sample-anyname", "xyz")
time.sleep(2)
getFilesList("xyz", "sample", "CU")
getFilesList("xyz","sample", "PYM")
getFilesList("xyz", "sample-anyname", "CU")
getFilesList("xyz","sample-anyname", "PYM")
time.sleep(5)
download("sample", "CU", "u", "xyz")
clear("sample", "xyz")
destroy("sample", "xyz")
download("sample-anyname", "CU", "u", "xyz")
clear("sample-anyname", "xyz")
destroy("sample-anyname", "xyz")
openJupyter()