diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index f31a8ba..be33ad1 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -14,7 +14,7 @@ jobs: with: fetch-depth: 0 - name: Replace media paths in README.md - run: sed -E 's#(\]\((docs/asset/[a-zA-Z0-9._-]+))#](https://github.com/CZ-NIC/mininterface/blob/main/\2?raw=True#g' README.md | less > README.md.tmp && mv README.md.tmp README.md + run: sed -E 's#(\]\((asset/[a-zA-Z0-9._-]+))#](https://github.com/CZ-NIC/mininterface/blob/main/\2?raw=True#g' README.md | less > README.md.tmp && mv README.md.tmp README.md - name: Build the package run: python3 -m pip install --upgrade build && python3 -m build - name: Publish package diff --git a/docs/index.md b/docs/index.md index 15fed22..1686129 100644 --- a/docs/index.md +++ b/docs/index.md @@ -42,8 +42,6 @@ if __name__ == "__main__": ## You got CLI It was all the code you need. No lengthy blocks of code imposed by an external dependency. Besides the GUI/TUI, you receive powerful YAML-configurable CLI parsing. -TODO regenerate output and all the images -TODO it seems that input missing dataclass fields is broken, it just shows it must be set via cli ```bash $ ./hello.py @@ -277,6 +275,13 @@ m.form(my_dictionary) + + + + + + + diff --git a/mininterface/mininterface.py b/mininterface/mininterface.py index b71843e..63f6301 100644 --- a/mininterface/mininterface.py +++ b/mininterface/mininterface.py @@ -196,11 +196,12 @@ def form(self, form: FormDictOrEnv | None = None, title: str = "") -> FormDictOr title: Optional form title Returns: - dict or dataclass: + dataclass: If the `form` is null, the output is [`self.env`][mininterface.Mininterface.env]. - + dict: If the `form` is a dict, the output is another dict. - Whereas the original form stays intact (with the values update), + + Whereas the original dict stays intact (with the values updated), we return a new raw dict with all values resolved (all [`Tag`][mininterface.Tag] objects are resolved to their value). @@ -215,6 +216,7 @@ def form(self, form: FormDictOrEnv | None = None, title: str = "") -> FormDictOr print(output["my label"]) # False ``` + --- Why this behaviour? You need to do some validation, hence you put `Tag` objects in the input dict. Then, you just need to work with the values. diff --git a/pyproject.toml b/pyproject.toml index f2cf77f..9386ae1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "mininterface" -version = "0.6.0" +version = "0.6.1" description = "A minimal access to GUI, TUI, CLI and config" authors = ["Edvard Rejthar "] license = "GPL-3.0-or-later" @@ -15,7 +15,6 @@ readme = "README.md" python = "^3.10" tyro = "*" pyyaml = "*" -envelope = "*" requests = "*" textual = "*" tkinter-tooltip = "*"