Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Stanislav Yuliyanov
oc-dfg-clustering
Commits
936c466d
Commit
936c466d
authored
May 25, 2022
by
SimonGlomb
Browse files
generalize argument parsing
parent
b8861048
Changes
1
Hide whitespace changes
Inline
Side-by-side
code/frontend.py
View file @
936c466d
from
flask
import
Flask
,
render_template
,
request
import
os
from
sympy
import
arg
import
model
app
=
Flask
(
__name__
)
...
...
@@ -14,10 +16,8 @@ def hello_world():
@
app
.
route
(
"/run_code"
,
methods
=
[
"GET"
])
def
run_code
():
global
params
varX
=
"python ./code/main.py "
+
str
(
params
[
0
])
print
(
varX
)
os
.
system
(
"python ./code/main.py "
+
str
(
params
[
0
]))
arguments
=
" "
.
join
(
params
)
os
.
system
(
"python ./code/main.py "
+
str
(
arguments
))
return
"<p>Back to Main Page</p>"
@
app
.
route
(
"/set_params"
,
methods
=
[
"POST"
])
...
...
@@ -33,7 +33,6 @@ def set_params():
form
.
cluster_count
.
data
,
form
.
ocel_file_type
.
data
,
form
.
graph_file_type
.
data
]
print
(
params
)
if
form
.
validate_on_submit
():
return
"<p>Parameters where set successfully.</p>"
return
render_template
(
'start_page.html'
,
form
=
form
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment