flinventory 0.6.5__py3-none-any.whl → 0.6.9__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/defaulted_data.py +1 -1
- flinventory/signprinter_latex.py +36 -13
- {flinventory-0.6.5.dist-info → flinventory-0.6.9.dist-info}/METADATA +1 -1
- {flinventory-0.6.5.dist-info → flinventory-0.6.9.dist-info}/RECORD +7 -7
- {flinventory-0.6.5.dist-info → flinventory-0.6.9.dist-info}/WHEEL +0 -0
- {flinventory-0.6.5.dist-info → flinventory-0.6.9.dist-info}/entry_points.txt +0 -0
- {flinventory-0.6.5.dist-info → flinventory-0.6.9.dist-info}/licenses/LICENSE +0 -0
flinventory/defaulted_data.py
CHANGED
@@ -106,7 +106,7 @@ class DefaultedDict(SuperDict):
|
|
106
106
|
return tuple(self._lists)
|
107
107
|
|
108
108
|
@property
|
109
|
-
def default_order(self) -> tuple[str]:
|
109
|
+
def default_order(self) -> tuple[str, ...]:
|
110
110
|
"""Default order of keys. Not changable."""
|
111
111
|
return tuple(self._default_order)
|
112
112
|
|
flinventory/signprinter_latex.py
CHANGED
@@ -136,7 +136,9 @@ class SignPrinterLaTeX:
|
|
136
136
|
try:
|
137
137
|
value = float(value)
|
138
138
|
except ValueError:
|
139
|
-
self.logger.error(
|
139
|
+
self.logger.error(
|
140
|
+
f"{key} {value} is not a number. Use {backup} {UNIT} instead."
|
141
|
+
)
|
140
142
|
return backup
|
141
143
|
if value <= 0:
|
142
144
|
self.logger.error(
|
@@ -163,6 +165,34 @@ class SignPrinterLaTeX:
|
|
163
165
|
thing.sign, key="height", backup=STANDARD_HEIGHT, max=MAX_HEIGHT
|
164
166
|
)
|
165
167
|
|
168
|
+
def image_height_vspace(
|
169
|
+
self, thing: BoxedThing, sign_height: Union[int, float]
|
170
|
+
) -> tuple[Union[int, float], Union[int, float]]:
|
171
|
+
"""Get the height of the image in the portrait sign.
|
172
|
+
|
173
|
+
In UNIT.
|
174
|
+
Args:
|
175
|
+
thing: the thing for which the sign is
|
176
|
+
sign_height: height of the sign. Needed for backup height.
|
177
|
+
"""
|
178
|
+
if sign_height < MINIMAL_HEIGHT_FOR_IMAGE:
|
179
|
+
return (
|
180
|
+
self.controlled_length(
|
181
|
+
thing.sign, key="imageheight", backup=0, max=sign_height
|
182
|
+
),
|
183
|
+
r"-1.5\baselineskip",
|
184
|
+
)
|
185
|
+
else:
|
186
|
+
return (
|
187
|
+
self.controlled_length(
|
188
|
+
thing.sign,
|
189
|
+
key="imageheight",
|
190
|
+
backup=sign_height * IMAGE_SHARE,
|
191
|
+
max=sign_height,
|
192
|
+
),
|
193
|
+
"1pt",
|
194
|
+
)
|
195
|
+
|
166
196
|
def if_use_landscape_template(self, thing: BoxedThing):
|
167
197
|
"""Return if we want to use the landscape template for this thing.
|
168
198
|
|
@@ -357,7 +387,7 @@ class SignPrinterLaTeX:
|
|
357
387
|
"""Create latex code (as str) that shows one sign in a minimal document."""
|
358
388
|
return "\n".join(
|
359
389
|
(
|
360
|
-
r"\documentclass{standalone}",
|
390
|
+
r"\documentclass[12pt]{standalone}",
|
361
391
|
*(self.pre.splitlines()[2:]),
|
362
392
|
self.create_sign(thing),
|
363
393
|
self.post,
|
@@ -418,13 +448,9 @@ class SignPrinterLaTeX:
|
|
418
448
|
if not insertions["location"]: # empty string
|
419
449
|
logging.warning(f"Print sign for {german} ({english}) without location.")
|
420
450
|
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
insertions["vspace"] = r"-1.5\baselineskip"
|
425
|
-
else:
|
426
|
-
insertions["imageheight"] = height * IMAGE_SHARE
|
427
|
-
insertions["vspace"] = "1pt"
|
451
|
+
insertions["imageheight"], insertions["vspace"] = self.image_height_vspace(
|
452
|
+
thing, height
|
453
|
+
)
|
428
454
|
|
429
455
|
# at first only portrait sign, landscape sign can be implemented later
|
430
456
|
# if self.if_use_landscape_template(thing): # would need different condition
|
@@ -506,7 +532,6 @@ class SignPrinterLaTeX:
|
|
506
532
|
program_missing.errno,
|
507
533
|
f"Program {LATEXMK_OPTIONS[0]} missing.",
|
508
534
|
program_missing.filename,
|
509
|
-
program_missing.winerror,
|
510
535
|
) from program_missing
|
511
536
|
else:
|
512
537
|
raise program_missing
|
@@ -544,7 +569,7 @@ class SignPrinterLaTeX:
|
|
544
569
|
path_svg = os.path.join(self.output_dir, file_svg)
|
545
570
|
if os.path.isfile(path_tex) and os.path.isfile(path_svg):
|
546
571
|
self.logger.info(f"Do not regenerate {tex_hash}.")
|
547
|
-
return
|
572
|
+
return path_svg
|
548
573
|
with open(path_tex, mode="w") as file_tex_f:
|
549
574
|
file_tex_f.write(tex)
|
550
575
|
try:
|
@@ -561,7 +586,6 @@ class SignPrinterLaTeX:
|
|
561
586
|
program_missing.errno,
|
562
587
|
f"Program {LATEXMK_OPTIONS[0]} missing.",
|
563
588
|
program_missing.filename,
|
564
|
-
program_missing.winerror,
|
565
589
|
) from program_missing
|
566
590
|
else:
|
567
591
|
raise program_missing
|
@@ -597,7 +621,6 @@ class SignPrinterLaTeX:
|
|
597
621
|
program_missing.errno,
|
598
622
|
"Program pdf2svg missing.",
|
599
623
|
program_missing.filename,
|
600
|
-
program_missing.winerror,
|
601
624
|
) from program_missing
|
602
625
|
else:
|
603
626
|
raise program_missing
|
@@ -1,18 +1,18 @@
|
|
1
|
-
flinventory-0.6.
|
2
|
-
flinventory-0.6.
|
3
|
-
flinventory-0.6.
|
4
|
-
flinventory-0.6.
|
1
|
+
flinventory-0.6.9.dist-info/METADATA,sha256=ty2_JtfVbc87G_ubjtViXq7KuTG1Ble19jdVU_rxB9Y,4907
|
2
|
+
flinventory-0.6.9.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
3
|
+
flinventory-0.6.9.dist-info/entry_points.txt,sha256=De3jjbHfy68_ZrwdjywlgrSUCn4QhqZGI0CJJt9S8_c,78
|
4
|
+
flinventory-0.6.9.dist-info/licenses/LICENSE,sha256=9c-AWlAEeFMmn1aODEfabsw2he-SpQeykurYw-KqSdw,34478
|
5
5
|
flinventory/__init__.py,sha256=0HTGxw9J-2KnbxQbzX6HH-Pztkp0BEjiHANhndfbtYM,270
|
6
6
|
flinventory/__main__.py,sha256=5U_RxWDlnhzlC98RaE8SkejjiYjv27OLdm5DPYgL4Gw,1295
|
7
7
|
flinventory/box.py,sha256=rk7yrAjVdxcrpvmTMt3jkMVOAoQNJfqoSig9U2S3yJ0,10480
|
8
8
|
flinventory/constant.py,sha256=4qb7gX-pQdr7fGq25dTkESe6B53yi4yILOF4Y8KtWk0,10672
|
9
9
|
flinventory/datacleanup.py,sha256=_CImmWJhq5uKz21jJQUqKYoQfbHEYA0000RyPRt5BI0,11363
|
10
|
-
flinventory/defaulted_data.py,sha256=
|
10
|
+
flinventory/defaulted_data.py,sha256=WbchY7w4jg4K5gQMzoqkqX1utcSEs8y7234gMeEPi4E,21590
|
11
11
|
flinventory/generate_labels.py,sha256=wjlyta9gowWOLvVfOVUQ8Ktpv3eg85JbAfDzI4Ok2V4,8476
|
12
12
|
flinventory/inventory_io.py,sha256=OWThcf9nzeZNqvNpzQiBhESQAnVXC7hUA8DEVzq-w-Y,12561
|
13
13
|
flinventory/location.py,sha256=UgJlbno16ipuFa4yUZK3SLrid70ACwE5He9Dd4P2SMU,16875
|
14
14
|
flinventory/sign.py,sha256=8G7fsne3Nsf8zZKKTUl40uWMNsWIv7FYV2KcqBR2MQI,5515
|
15
|
-
flinventory/signprinter_latex.py,sha256=
|
15
|
+
flinventory/signprinter_latex.py,sha256=0mSW9p_v-55aHZ2Do0reZ2B-Qpk32lF1q0Yijvk9Vtw,25481
|
16
16
|
flinventory/thing.py,sha256=86fXj3RwTbkCdVVWrbyO-VEW_e5lKJlV8PPt1Xf8ejY,5079
|
17
17
|
flinventory/thingtemplate_latex/.gitignore,sha256=DTF250Ttj8O2lxrQBwMNrQ73rWPvdwCytipfZSLFtlU,51
|
18
18
|
flinventory/thingtemplate_latex/dummyImage.jpg,sha256=bIBH5Lrxlr5qJ42nP1cpJXPRNGLOwyEuzwXFSvNwTSk,147857
|
@@ -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.6.
|
23
|
+
flinventory-0.6.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|