Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1abb7eb

Browse files
committedJan 28, 2025·
WIP
1 parent f41069c commit 1abb7eb

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed
 

‎docs/index.md

+8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ if __name__ == "__main__":
3939
- [Background](#background)
4040
- [Installation](#installation)
4141
- [Docs](#docs)
42+
- [Gallery](#gallery)
4243
- [Examples](#examples)
4344

4445
## You got CLI
@@ -121,6 +122,13 @@ If the GUI does not work on MacOS, you might need to launch: `brew install pytho
121122
# Docs
122123
See the docs overview at [https://cz-nic.github.io/mininterface/](https://cz-nic.github.io/mininterface/Overview/).
123124

125+
# Gallery
126+
127+
Some of the projects that reduced the code base thanks to the mininterface.
128+
129+
* **[deduplidog](https://github.com/CZ-NIC/deduplidog/)** – Find duplicates in a scattered directory structure
130+
* **[touch-timestamp](https://github.com/CZ-NIC/touch-timestamp/)** – A powerful dialog to change the files' timestamp
131+
124132
# Examples
125133

126134
A powerful [`m.form`](https://cz-nic.github.io/mininterface/Mininterface/#mininterface.Mininterface.form) dialog method accepts either a dataclass or a dict. Take a look on both.

‎mininterface/auxiliary.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def subclass_matches_annotation(cls, annotation) -> bool:
129129
return True
130130

131131
# simple types like scalars
132-
return issubclass(cls, annotation)
132+
return issubclass(cls, annotation) # TODO tuple[int, str] is not a class
133133

134134

135135
def serialize_structure(obj):

‎tests/tests.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,8 @@ def test_subclass_matches_annotation(self):
506506
self.assertFalse(subclass_matches_annotation(int, annotation))
507507

508508
# The subclass_matches_annotation is not almighty. Tag behaves better:
509-
self.assertTrue(Tag(annotation=annotation)._is_subclass(tuple[int, str]))
509+
self.assertTrue(Tag(annotation=annotation)._is_subclass(tuple[int, str])) # TODO
510+
# TODO fails issubclass(tuple[int, str], ...) arg 1 must be a class
510511
# NOTE but this should work too
511512
# self.assertTrue(Tag(annotation=annotation)._is_subclass(list[int]))
512513

@@ -611,6 +612,7 @@ def test_wrong_fields(self):
611612

612613
def test_run_ask_for_missing_union(self):
613614
form = """Asking the form {'path': PathTag(val=MISSING, description='', annotation=str | pathlib.Path, name='path'), 'combined': Tag(val=MISSING, description='', annotation=int | tuple[int, int] | None, name='combined'), 'simple_tuple': Tag(val=MISSING, description='', annotation=tuple[int, int], name='simple_tuple')}"""
615+
self.maxDiff = None # TODO
614616
with self.assertOutputs(form):
615617
runm(MissingNonscalar)
616618

0 commit comments

Comments
 (0)
Please sign in to comment.