flinventory 2.2.2__tar.gz → 2.2.3__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.
Files changed (25) hide show
  1. {flinventory-2.2.2 → flinventory-2.2.3}/PKG-INFO +1 -1
  2. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/labelprinter_typst.py +6 -5
  3. {flinventory-2.2.2 → flinventory-2.2.3}/pyproject.toml +1 -1
  4. {flinventory-2.2.2 → flinventory-2.2.3}/LICENSE +0 -0
  5. {flinventory-2.2.2 → flinventory-2.2.3}/README.md +0 -0
  6. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/__init__.py +0 -0
  7. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/__main__.py +0 -0
  8. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/box.py +0 -0
  9. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/constant.py +0 -0
  10. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/datacleanup.py +0 -0
  11. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/defaulted_data.py +0 -0
  12. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/font_location.py +0 -0
  13. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/generate_labels.py +0 -0
  14. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/inventory_io.py +0 -0
  15. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/location.py +0 -0
  16. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/sign.py +0 -0
  17. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/signprinter_latex.py +0 -0
  18. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/thing.py +0 -0
  19. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/thingtemplate_typst/dummyImage.jpg +0 -0
  20. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/thingtemplate_typst/label.typ +0 -0
  21. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/thingtemplate_typst/out/bowdenzugklemmung1.svg +0 -0
  22. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/thingtemplate_typst/out/things.log +0 -0
  23. {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/thingtemplate_typst/thinglist.typ +0 -0
  24. {flinventory-2.2.2 → flinventory-2.2.3}/tests/__init__.py +0 -0
  25. {flinventory-2.2.2 → flinventory-2.2.3}/tests/test_defaulted_data.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flinventory
3
- Version: 2.2.2
3
+ Version: 2.2.3
4
4
  Summary: An inventory system for self-help repair shops
5
5
  Author-Email: flukx <flinventory-flukx@612211124.xyz>
6
6
  License: GPL3
@@ -134,7 +134,7 @@ class LabelPrinter:
134
134
  thing: thing with sign and location. Use information from sign if it has it.
135
135
  Otherwise, from label in location. Otherwise, None.
136
136
  key: the queried dimension
137
- maximum: Maximum value. If None, do not check for maximum.
137
+ maximum: Maximum value (in unit `unit`). If None, do not check for maximum.
138
138
  unit: unit of the output
139
139
  """
140
140
  assert not isinstance(
@@ -143,8 +143,9 @@ class LabelPrinter:
143
143
  value = self.in_unit(self.get_label_value(thing, key), default_unit=unit)
144
144
  if value is None:
145
145
  return None
146
+ value = value / TYPST_UNITS[unit]
146
147
  value = value if maximum is None else min(value, maximum)
147
- return f"{value}{unit}" if isinstance(value, int) else f"{value:3f}{unit}"
148
+ return f"{value}{unit}" if int(value) == value else f"{value:.3f}{unit}"
148
149
 
149
150
  def thing_data(self, thing: BoxedThing) -> dict[str, str]:
150
151
  """Get values for the insertion into the templates for one thing."""
@@ -154,13 +155,13 @@ class LabelPrinter:
154
155
  "name_1": thing.sign.get(("name", 0), None),
155
156
  "name_1_height": self.get_label_value(thing, ("name_height", 0)),
156
157
  "name_1_font_size": self.controlled_length(
157
- thing, ("font_size", 0), unit="pt"
158
+ thing, ("font_size", 0), unit=FONT_UNIT
158
159
  ),
159
160
  "lang_1": thing.options.languages[0], # one language is guaranteed
160
161
  "name_2": thing.sign.get(("name", 1), None),
161
162
  "name_2_height": self.get_label_value(thing, ("name_height", 1)),
162
163
  "name_2_font_size": self.controlled_length(
163
- thing, ("font_size", 1), unit="pt"
164
+ thing, ("font_size", 1), unit=FONT_UNIT
164
165
  ),
165
166
  "lang_2": (thing.options.languages + [None])[1], # None is default
166
167
  # Following 8 cases exist:
@@ -181,7 +182,7 @@ class LabelPrinter:
181
182
  else str(thing.where)
182
183
  ),
183
184
  "where_font_size": self.controlled_length(
184
- thing, "font_size_location", unit="pt"
185
+ thing, "font_size_location", unit=FONT_UNIT
185
186
  ),
186
187
  }
187
188
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "flinventory"
3
- version = "2.2.2"
3
+ version = "2.2.3"
4
4
  description = "An inventory system for self-help repair shops"
5
5
  authors = [
6
6
  { name = "flukx", email = "flinventory-flukx@612211124.xyz" },
File without changes
File without changes