Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
clive
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
clive
Commits
6a858073
Commit
6a858073
authored
1 year ago
by
Krzysztof Mochocki
Committed by
Mateusz Żebrak
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Dynamic global properties are stored in app state
parent
48493602
No related branches found
No related tags found
3 merge requests
!186
V1.27.5.0 release
,
!174
RELEASE: 1
,
!102
Redesign header
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
clive/__private/core/app_state.py
+9
-0
9 additions, 0 deletions
clive/__private/core/app_state.py
clive/__private/core/commands/commands.py
+3
-1
3 additions, 1 deletion
clive/__private/core/commands/commands.py
with
12 additions
and
1 deletion
clive/__private/core/app_state.py
+
9
−
0
View file @
6a858073
...
@@ -3,6 +3,8 @@ from __future__ import annotations
...
@@ -3,6 +3,8 @@ from __future__ import annotations
from
dataclasses
import
dataclass
from
dataclasses
import
dataclass
from
typing
import
TYPE_CHECKING
from
typing
import
TYPE_CHECKING
from
clive.__private.core.commands.update_node_data
import
DynamicGlobalPropertiesT
# noqa: TCH001
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
from
clive.__private.core.world
import
World
from
clive.__private.core.world
import
World
...
@@ -12,6 +14,13 @@ class AppState:
...
@@ -12,6 +14,13 @@ class AppState:
"""
A class that holds information about the current state of an application.
"""
"""
A class that holds information about the current state of an application.
"""
world
:
World
world
:
World
_dynamic_global_properties
:
DynamicGlobalPropertiesT
|
None
=
None
def
get_dynamic_global_properties
(
self
)
->
DynamicGlobalPropertiesT
:
if
self
.
_dynamic_global_properties
is
None
:
self
.
world
.
commands
.
update_node_data
(
accounts
=
[])
assert
self
.
_dynamic_global_properties
is
not
None
return
self
.
_dynamic_global_properties
def
is_active
(
self
)
->
bool
:
def
is_active
(
self
)
->
bool
:
wallets
=
self
.
world
.
beekeeper
.
api
.
list_wallets
().
wallets
wallets
=
self
.
world
.
beekeeper
.
api
.
list_wallets
().
wallets
...
...
This diff is collapsed.
Click to expand it.
clive/__private/core/commands/commands.py
+
3
−
1
View file @
6a858073
...
@@ -95,4 +95,6 @@ class Commands:
...
@@ -95,4 +95,6 @@ class Commands:
).
execute
()
).
execute
()
def
update_node_data
(
self
,
*
,
accounts
:
list
[
Account
])
->
None
:
def
update_node_data
(
self
,
*
,
accounts
:
list
[
Account
])
->
None
:
UpdateNodeData
(
accounts
=
accounts
,
node
=
self
.
__world
.
node
).
execute
()
self
.
__world
.
app_state
.
_dynamic_global_properties
=
UpdateNodeData
(
accounts
=
accounts
,
node
=
self
.
__world
.
node
).
execute_with_result
()
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