streambricks 0.2.4__tar.gz → 0.2.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {streambricks-0.2.4 → streambricks-0.2.5}/PKG-INFO +1 -1
- {streambricks-0.2.4 → streambricks-0.2.5}/src/streambricks/__init__.py +1 -1
- {streambricks-0.2.4 → streambricks-0.2.5}/src/streambricks/state.py +21 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/.copier-answers.yml +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/.github/FUNDING.yml +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/.github/copilot-instructions.md +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/.github/dependabot.yml +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/.github/workflows/build.yml +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/.github/workflows/documentation.yml +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/.gitignore +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/.pre-commit-config.yaml +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/LICENSE +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/README.md +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/docs/.empty +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/duties.py +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/mkdocs.yml +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/overrides/_dummy.txt +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/pyproject.toml +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/src/streambricks/helpers.py +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/src/streambricks/py.typed +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/src/streambricks/widgets/__init__.py +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/src/streambricks/widgets/model_selector.py +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/src/streambricks/widgets/model_widget.py +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/src/streambricks/widgets/multi_select.py +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/src/streambricks/widgets/type_helpers.py +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/tests/__init__.py +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/tests/conftest.py +0 -0
- {streambricks-0.2.4 → streambricks-0.2.5}/tests/test_widgets.py +0 -0
|
@@ -30,3 +30,24 @@ class State(BaseModel):
|
|
|
30
30
|
st.session_state[state_key] = cls()
|
|
31
31
|
|
|
32
32
|
return st.session_state[state_key]
|
|
33
|
+
|
|
34
|
+
@classmethod
|
|
35
|
+
def set(cls, *, key: str | None = None, value: Self):
|
|
36
|
+
"""Set state to given model.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
key: Optional key to use in session_state (defaults to model class name)
|
|
40
|
+
value: The value to set in session_state
|
|
41
|
+
"""
|
|
42
|
+
state_key = key or cls.__name__
|
|
43
|
+
st.session_state[state_key] = value
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def reset(cls, *, key: str | None = None):
|
|
47
|
+
"""Reset state.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
key: Optional key to use in session_state (defaults to model class name)
|
|
51
|
+
"""
|
|
52
|
+
state_key = key or cls.__name__
|
|
53
|
+
st.session_state[state_key] = cls()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|