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
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dos
flow3r firmware
Commits
132bf340
Commit
132bf340
authored
Aug 11, 2023
by
Sec 42
Committed by
q3k
Aug 12, 2023
Browse files
Options
Downloads
Patches
Plain Diff
sim, py: optional argument to start app dirctly
parent
0022b633
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
python_payload/st3m/run.py
+12
-1
12 additions, 1 deletion
python_payload/st3m/run.py
sim/run.py
+4
-0
4 additions, 0 deletions
sim/run.py
with
16 additions
and
1 deletion
python_payload/st3m/run.py
+
12
−
1
View file @
132bf340
from
st3m.reactor
import
Reactor
,
Responder
from
st3m.reactor
import
Reactor
,
Responder
from
st3m.goose
import
List
from
st3m.goose
import
List
,
Optional
from
st3m.ui.menu
import
(
from
st3m.ui.menu
import
(
MenuItem
,
MenuItem
,
MenuItemBack
,
MenuItemBack
,
...
@@ -23,6 +23,9 @@ import machine
...
@@ -23,6 +23,9 @@ import machine
log
=
logging
.
Log
(
__name__
,
level
=
logging
.
INFO
)
log
=
logging
.
Log
(
__name__
,
level
=
logging
.
INFO
)
#: Can be set to a bundle name that should be started instead of the main menu when run_main is called.
override_main_app
:
Optional
[
str
]
=
None
def
_make_reactor
()
->
Reactor
:
def
_make_reactor
()
->
Reactor
:
reactor
=
Reactor
()
reactor
=
Reactor
()
...
@@ -144,6 +147,14 @@ def run_main() -> None:
...
@@ -144,6 +147,14 @@ def run_main() -> None:
MenuItemForeground
(
"
System
"
,
menu_system
),
MenuItemForeground
(
"
System
"
,
menu_system
),
],
],
)
)
if
override_main_app
is
not
None
:
requested
=
[
b
for
b
in
bundles
if
b
.
name
==
override_main_app
]
print
([
b
.
name
for
b
in
bundles
])
if
len
(
requested
)
>
1
:
raise
Exception
(
f
"
More than one bundle named
{
override_main_app
}
"
)
if
len
(
requested
)
==
0
:
raise
Exception
(
f
"
Requested bundle
{
override_main_app
}
not found
"
)
run_view
(
requested
[
0
].
load
())
run_view
(
menu_main
)
run_view
(
menu_main
)
...
...
This diff is collapsed.
Click to expand it.
sim/run.py
+
4
−
0
View file @
132bf340
...
@@ -111,5 +111,9 @@ if len(sys.argv) >= 2 and sys.argv[1] == "screenshot":
...
@@ -111,5 +111,9 @@ if len(sys.argv) >= 2 and sys.argv[1] == "screenshot":
import
hardware
import
hardware
hardware
.
SCREENSHOT
=
True
hardware
.
SCREENSHOT
=
True
elif
len
(
sys
.
argv
)
==
2
:
import
st3m.run
st3m
.
run
.
override_main_app
=
sys
.
argv
[
1
]
import
main
import
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