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
028cbfe2
Commit
028cbfe2
authored
1 year ago
by
ave
Committed by
ave
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
expose bundle metadata to ApplicationContext
parent
cf7cdc06
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
python_payload/st3m/application.py
+7
-2
7 additions, 2 deletions
python_payload/st3m/application.py
with
7 additions
and
2 deletions
python_payload/st3m/application.py
+
7
−
2
View file @
028cbfe2
...
@@ -30,13 +30,18 @@ class ApplicationContext:
...
@@ -30,13 +30,18 @@ class ApplicationContext:
_bundle_path
:
str
_bundle_path
:
str
def
__init__
(
self
,
bundle_path
:
str
=
""
)
->
None
:
def
__init__
(
self
,
bundle_path
:
str
=
""
,
bundle_metadata
:
dict
=
None
)
->
None
:
self
.
_bundle_path
=
bundle_path
self
.
_bundle_path
=
bundle_path
self
.
_bundle_metadata
=
bundle_metadata
@property
@property
def
bundle_path
(
self
)
->
str
:
def
bundle_path
(
self
)
->
str
:
return
self
.
_bundle_path
return
self
.
_bundle_path
@property
def
bundle_metadata
(
self
)
->
str
:
return
self
.
_bundle_metadata
class
Application
(
BaseView
):
class
Application
(
BaseView
):
def
__init__
(
self
,
app_ctx
:
ApplicationContext
)
->
None
:
def
__init__
(
self
,
app_ctx
:
ApplicationContext
)
->
None
:
...
@@ -172,7 +177,7 @@ class BundleMetadata:
...
@@ -172,7 +177,7 @@ class BundleMetadata:
log
.
info
(
f
"
Loaded
{
self
.
name
}
module:
{
m
}
"
)
log
.
info
(
f
"
Loaded
{
self
.
name
}
module:
{
m
}
"
)
klass
=
getattr
(
m
,
class_entry
)
klass
=
getattr
(
m
,
class_entry
)
log
.
info
(
f
"
Loaded
{
self
.
name
}
class:
{
klass
}
"
)
log
.
info
(
f
"
Loaded
{
self
.
name
}
class:
{
klass
}
"
)
inst
=
klass
(
ApplicationContext
(
self
.
path
))
inst
=
klass
(
ApplicationContext
(
self
.
path
,
self
.
_t
))
log
.
info
(
f
"
Instantiated
{
self
.
name
}
class:
{
inst
}
"
)
log
.
info
(
f
"
Instantiated
{
self
.
name
}
class:
{
inst
}
"
)
return
inst
# type: ignore
return
inst
# type: ignore
except
Exception
as
e
:
except
Exception
as
e
:
...
...
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