Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
flow3r
flow3r firmware
Commits
65f28a6c
Commit
65f28a6c
authored
1 year ago
by
rahix
Browse files
Options
Downloads
Patches
Plain Diff
sim: Use argparse instead of hack arg parsing
parent
a2558f20
No related branches found
No related tags found
No related merge requests found
Pipeline
#7214
passed
1 year ago
Stage: check
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+1
-1
1 addition, 1 deletion
.gitlab-ci.yml
sim/run.py
+18
-6
18 additions, 6 deletions
sim/run.py
with
19 additions
and
7 deletions
.gitlab-ci.yml
+
1
−
1
View file @
65f28a6c
...
@@ -55,7 +55,7 @@ build:
...
@@ -55,7 +55,7 @@ build:
simulate
:
simulate
:
stage
:
build
stage
:
build
script
:
script
:
-
python3 sim/run.py screenshot
-
python3 sim/run.py
--
screenshot
artifacts
:
artifacts
:
expose_as
:
'
Smulator
Screenshot'
expose_as
:
'
Smulator
Screenshot'
paths
:
[
'
flow3r.png'
]
paths
:
[
'
flow3r.png'
]
...
...
This diff is collapsed.
Click to expand it.
sim/run.py
+
18
−
6
View file @
65f28a6c
...
@@ -6,6 +6,7 @@ import importlib.util
...
@@ -6,6 +6,7 @@ import importlib.util
import
os
import
os
import
sys
import
sys
import
builtins
import
builtins
import
argparse
projectpath
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)))
projectpath
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
)))
...
@@ -112,13 +113,24 @@ def _stat(path):
...
@@ -112,13 +113,24 @@ def _stat(path):
os
.
stat
=
_stat
os
.
stat
=
_stat
if
len
(
sys
.
argv
)
>=
2
and
sys
.
argv
[
1
]
==
"
screenshot
"
:
def
sim_main
():
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
--screenshot
"
,
action
=
"
store_true
"
,
default
=
False
)
parser
.
add_argument
(
"
override_app
"
,
nargs
=
"
?
"
)
args
=
parser
.
parse_args
()
import
_sim
import
_sim
_sim
.
SCREENSHOT
=
True
_sim
.
SCREENSHOT
=
args
.
screenshot
elif
len
(
sys
.
argv
)
==
2
:
if
args
.
override_app
is
not
None
:
import
st3m.run
import
st3m.run
st3m
.
run
.
override_main_app
=
sys
.
argv
[
1
]
st3m
.
run
.
override_main_app
=
args
.
override_app
import
main
import
main
if
__name__
==
"
__main__
"
:
sim_main
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment