flinventory 0.4.2__py3-none-any.whl → 0.5.0__py3-none-any.whl

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.
flinventory/__main__.py CHANGED
@@ -34,7 +34,8 @@ def parse_args():
34
34
  return parser.parse_args()
35
35
 
36
36
 
37
- if __name__ == "__main__":
37
+ def main():
38
+ """Run the command-line interface."""
38
39
  arguments = parse_args()
39
40
  datacleanup.logging_config(arguments)
40
41
  try:
@@ -43,3 +44,7 @@ if __name__ == "__main__":
43
44
  print("No command given. See -h for help information.")
44
45
  else:
45
46
  function(arguments)
47
+
48
+
49
+ if __name__ == "__main__":
50
+ main()
flinventory/location.py CHANGED
@@ -213,12 +213,13 @@ class Schema:
213
213
  ).get_schema_hierarchy(location_info)
214
214
 
215
215
  def get_valid_subs(
216
- self, shortcuts: Literal["yes", "only", "()", "*"] = "yes"
216
+ self, shortcuts: Literal["yes", "only", "()", "*", "no"] = "yes"
217
217
  ) -> Optional[list[Union[str, int]]]:
218
218
  """A list of valid sub schemas. Usable for suggesting options.
219
219
 
220
220
  Args:
221
221
  shortcuts: if valid shortcuts should be listed as well:
222
+ 'no': shortcuts are not listed
222
223
  'yes': shortcuts listed in the same way as names,
223
224
  'only': only shortcuts are listed
224
225
  '()': shortcuts are listed in parentheses after the name (note: result
@@ -232,6 +233,8 @@ class Schema:
232
233
  return None
233
234
  if self._subs is None:
234
235
  return []
236
+ if shortcuts == "no":
237
+ return [sub.name for sub in self._subs]
235
238
  if shortcuts == "yes":
236
239
  return [name for sub in self._subs for name in (sub.name, sub.shortcut)]
237
240
  if shortcuts == "only":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flinventory
3
- Version: 0.4.2
3
+ Version: 0.5.0
4
4
  Summary: An inventory system for self-help repair shops
5
5
  Author-Email: flukx <flinventory-flukx@612211124.xyz>
6
6
  License: GPL3
@@ -55,9 +55,23 @@ The data format is a specific directory structure with specific file names:
55
55
 
56
56
  No keys in `things/someID/*yaml` are mandatory. Therefore, code that uses the data has to handle missing data.
57
57
 
58
- ## Functionalities
59
- With this repository alone, entering data means writing the json files by hand. For a GUI method, see [flinventory-GUI](https://codeberg.org/flukx/flinventory-gui).
58
+ ## Install
59
+ `pip install flinventory`
60
60
 
61
- The scripts are
62
- - `generate_labels.py` for creating signs that can be printed and glued to the boxes. The size and formatting of the signs happens in `things/*/sign.json`. Also it creates a list of all names of all things with a reference to their location. This list is in markdown and can be converted with pandoc to a printable (multiple page) list. For details see the help messages.
63
- - `datacleanup.py` for various tasks for reformatting the yaml files. This is helpful to have a bit of standardisation to avoid big git diffs when the yaml files are read and written again. For details see the help messages.
61
+ or
62
+ ```
63
+ git clone https://codeberg.org/flukx/flinventory
64
+ # install requirements listed in pyproject.toml
65
+ # e.g. with
66
+ nix-shell
67
+ ```
68
+
69
+ ## Usage
70
+ flinventory is mainly intended as a python module used
71
+ in the [flinventory-GUI](https://codeberg.org/flukx/flinventory-gui).
72
+ But by installing this module, also the command-line interface `flinventory-cli` is installed.
73
+ (It can also be run with the repo and `python -m flinventory`.)
74
+
75
+ This command-line interface includes
76
+ - `flinventory-cli label` for creating signs that can be printed and glued to the boxes. The size and formatting of the signs happens in `things/*/sign.json`. Also, it creates a list of all names of all things with a reference to their location. This list is in markdown and can be converted with pandoc to a printable (multiple page) list. For details see the help messages.
77
+ - `flinventory-cli {normalize,printed,shortcut,unprinted,useIDs,locationsFile}` for various tasks for reformatting the yaml files. This is helpful to have a bit of standardisation to avoid big git diffs when the yaml files are read and written again. For details see the help messages.
@@ -1,16 +1,16 @@
1
- flinventory-0.4.2.dist-info/METADATA,sha256=ZQjK-O4pZu_8nTuBLmDKJ0iSepizKaVkxaGIRP-cTnc,4542
2
- flinventory-0.4.2.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
- flinventory-0.4.2.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
- flinventory-0.4.2.dist-info/licenses/LICENSE,sha256=9c-AWlAEeFMmn1aODEfabsw2he-SpQeykurYw-KqSdw,34478
1
+ flinventory-0.5.0.dist-info/METADATA,sha256=hJhT7XOxDx-C0be0YzyJyBtG-CzCOpFNk8Vk9DC-15M,4907
2
+ flinventory-0.5.0.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
+ flinventory-0.5.0.dist-info/entry_points.txt,sha256=De3jjbHfy68_ZrwdjywlgrSUCn4QhqZGI0CJJt9S8_c,78
4
+ flinventory-0.5.0.dist-info/licenses/LICENSE,sha256=9c-AWlAEeFMmn1aODEfabsw2he-SpQeykurYw-KqSdw,34478
5
5
  flinventory/__init__.py,sha256=0HTGxw9J-2KnbxQbzX6HH-Pztkp0BEjiHANhndfbtYM,270
6
- flinventory/__main__.py,sha256=YI3dGiBr1i56JpGommQTWYjgfCmhr2JT1pQUdf0lf1w,1228
6
+ flinventory/__main__.py,sha256=5U_RxWDlnhzlC98RaE8SkejjiYjv27OLdm5DPYgL4Gw,1295
7
7
  flinventory/box.py,sha256=rk7yrAjVdxcrpvmTMt3jkMVOAoQNJfqoSig9U2S3yJ0,10480
8
8
  flinventory/constant.py,sha256=pPNCwScLon_MOKL9_jjD_sxqB7Q2WW6rZqtrBl7SyWk,10283
9
9
  flinventory/datacleanup.py,sha256=_CImmWJhq5uKz21jJQUqKYoQfbHEYA0000RyPRt5BI0,11363
10
10
  flinventory/defaulted_data.py,sha256=KAy6V2KLcifLg7zHBFnx_eFLp31sCWih1Btp6cE0bQc,21585
11
11
  flinventory/generate_labels.py,sha256=wB9ibokHOcab599qZhi5uTzfy3DTo3wT4DJP9qLMzXs,6642
12
12
  flinventory/inventory_io.py,sha256=OWThcf9nzeZNqvNpzQiBhESQAnVXC7hUA8DEVzq-w-Y,12561
13
- flinventory/location.py,sha256=eaZ8tF8HdzH17IBDl3_p_MsnSw5-H1GfbvkTe3dPFGk,16593
13
+ flinventory/location.py,sha256=kJoR5iZF-loimiqEUCaSpDXDDGYV8FECZxodh68Rp9U,16728
14
14
  flinventory/sign.py,sha256=8G7fsne3Nsf8zZKKTUl40uWMNsWIv7FYV2KcqBR2MQI,5515
15
15
  flinventory/signprinter_latex.py,sha256=Ytf1T_ADedj_Wkqe8bWyN23-TwFaKE7zFpeoYxn5NzM,19105
16
16
  flinventory/thing.py,sha256=86fXj3RwTbkCdVVWrbyO-VEW_e5lKJlV8PPt1Xf8ejY,5079
@@ -20,4 +20,4 @@ flinventory/thingtemplate_latex/sign.tex,sha256=cVlOjImuS97Gf19MGW27HiP6Uw8JNnob
20
20
  flinventory/thingtemplate_latex/signlist-footer.tex,sha256=LcZw5__h8SqgMmYxs5oLbXLaFTQlx_X5rtYnpxwUh9Y,14
21
21
  flinventory/thingtemplate_latex/signlist-header.tex,sha256=F1J4aSPq6QO_Ved4Zn7-rytP1vDkdWTqjjtGJpe_FDg,297
22
22
  flinventory/thingtemplate_latex/signs-example.tex,sha256=J6eCcPhP0Xklgn8xnSenDOvjzmc_NGmakWU4RGbeUtM,3090
23
- flinventory-0.4.2.dist-info/RECORD,,
23
+ flinventory-0.5.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ [console_scripts]
2
+ flinventory-cli = flinventory.__main__:main
3
+
4
+ [gui_scripts]
5
+
@@ -1,4 +0,0 @@
1
- [console_scripts]
2
-
3
- [gui_scripts]
4
-