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
15 changes: 10 additions & 5 deletions fri/server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,19 @@ def getFilesList(dir):
concore_path = os.path.abspath(os.path.join(cur_path, '../../'))
dir_path = os.path.abspath(os.path.join(concore_path, dir))
res = []

if(dir=='concore'):
res = os.listdir(concore_path)
else:
res = os.listdir(dir_path)
res = os.listdir(dir_path)
res2 = json.dumps(res)
return res2


@app.route('/openJupyter/', methods=['POST'])
def openJupyter():
cur_path = os.getcwd()
concore_path = os.path.abspath(os.path.join(cur_path, '../../'))
p = call(["jupyter", "lab"], cwd=concore_path)
return p



if __name__ == "__main__":
app.run(host="0.0.0.0")
9 changes: 7 additions & 2 deletions fri/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,14 @@ def destroy():
print(response.text)

def getFilesList():
import requests
url = "http://127.0.0.1:5000/getFilesList/test"
response = requests.request("POST", url)
print(response.text)
print(response.text)

def openJupyter():
url = "http://127.0.0.1:5000/openJupyter"
response = requests.request("POST", url)
print(response.text)


# upload()
Expand All @@ -77,4 +81,5 @@ def getFilesList():
# debug()
# destroy()
getFilesList()
# openJupyter()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openJupyter

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, pay attention to typos, even if the code works. Codes with typos are hard to maintain.

5 changes: 5 additions & 0 deletions mkconcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,8 @@
#start running source in associated dirs (run and debug scripts)
if concoretype=="posix":
fdebug.write('#!/bin/bash' + "\n")
frun.write('#!/bin/bash' + "\n")


i=0
for node in nodes_dict:
Expand Down Expand Up @@ -826,6 +828,9 @@
i=i+1
fmaxtime.close()

if concoretype=="posix":
funlock.write('#!/bin/bash' + "\n")

i=0 # 9/12/21
for node in nodes_dict:
containername,sourcecode = nodes_dict[node].split(':')
Expand Down