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.
- {flinventory-2.2.2 → flinventory-2.2.3}/PKG-INFO +1 -1
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/labelprinter_typst.py +6 -5
- {flinventory-2.2.2 → flinventory-2.2.3}/pyproject.toml +1 -1
- {flinventory-2.2.2 → flinventory-2.2.3}/LICENSE +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/README.md +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/__init__.py +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/__main__.py +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/box.py +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/constant.py +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/datacleanup.py +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/defaulted_data.py +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/font_location.py +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/generate_labels.py +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/inventory_io.py +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/location.py +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/sign.py +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/signprinter_latex.py +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/thing.py +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/thingtemplate_typst/dummyImage.jpg +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/thingtemplate_typst/label.typ +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/thingtemplate_typst/out/bowdenzugklemmung1.svg +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/thingtemplate_typst/out/things.log +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/flinventory/thingtemplate_typst/thinglist.typ +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/tests/__init__.py +0 -0
- {flinventory-2.2.2 → flinventory-2.2.3}/tests/test_defaulted_data.py +0 -0
|
@@ -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
|
|
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=
|
|
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=
|
|
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=
|
|
185
|
+
thing, "font_size_location", unit=FONT_UNIT
|
|
185
186
|
),
|
|
186
187
|
}
|
|
187
188
|
|
|
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
|
{flinventory-2.2.2 → flinventory-2.2.3}/flinventory/thingtemplate_typst/out/bowdenzugklemmung1.svg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|