flinventory 0.6.6__tar.gz → 0.6.9__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 (24) hide show
  1. {flinventory-0.6.6 → flinventory-0.6.9}/PKG-INFO +1 -1
  2. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/signprinter_latex.py +32 -11
  3. {flinventory-0.6.6 → flinventory-0.6.9}/pyproject.toml +1 -1
  4. {flinventory-0.6.6 → flinventory-0.6.9}/LICENSE +0 -0
  5. {flinventory-0.6.6 → flinventory-0.6.9}/README.md +0 -0
  6. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/__init__.py +0 -0
  7. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/__main__.py +0 -0
  8. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/box.py +0 -0
  9. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/constant.py +0 -0
  10. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/datacleanup.py +0 -0
  11. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/defaulted_data.py +0 -0
  12. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/generate_labels.py +0 -0
  13. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/inventory_io.py +0 -0
  14. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/location.py +0 -0
  15. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/sign.py +0 -0
  16. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/thing.py +0 -0
  17. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/thingtemplate_latex/.gitignore +0 -0
  18. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/thingtemplate_latex/dummyImage.jpg +0 -0
  19. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/thingtemplate_latex/sign.tex +0 -0
  20. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/thingtemplate_latex/signlist-footer.tex +0 -0
  21. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/thingtemplate_latex/signlist-header.tex +0 -0
  22. {flinventory-0.6.6 → flinventory-0.6.9}/flinventory/thingtemplate_latex/signs-example.tex +0 -0
  23. {flinventory-0.6.6 → flinventory-0.6.9}/tests/__init__.py +0 -0
  24. {flinventory-0.6.6 → flinventory-0.6.9}/tests/test_defaulted_data.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flinventory
3
- Version: 0.6.6
3
+ Version: 0.6.9
4
4
  Summary: An inventory system for self-help repair shops
5
5
  Author-Email: flukx <flinventory-flukx@612211124.xyz>
6
6
  License: GPL3
@@ -165,6 +165,34 @@ class SignPrinterLaTeX:
165
165
  thing.sign, key="height", backup=STANDARD_HEIGHT, max=MAX_HEIGHT
166
166
  )
167
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
+
168
196
  def if_use_landscape_template(self, thing: BoxedThing):
169
197
  """Return if we want to use the landscape template for this thing.
170
198
 
@@ -359,7 +387,7 @@ class SignPrinterLaTeX:
359
387
  """Create latex code (as str) that shows one sign in a minimal document."""
360
388
  return "\n".join(
361
389
  (
362
- r"\documentclass{standalone}",
390
+ r"\documentclass[12pt]{standalone}",
363
391
  *(self.pre.splitlines()[2:]),
364
392
  self.create_sign(thing),
365
393
  self.post,
@@ -420,13 +448,9 @@ class SignPrinterLaTeX:
420
448
  if not insertions["location"]: # empty string
421
449
  logging.warning(f"Print sign for {german} ({english}) without location.")
422
450
 
423
- # todo: make image height configurable
424
- if height < MINIMAL_HEIGHT_FOR_IMAGE:
425
- insertions["imageheight"] = 0
426
- insertions["vspace"] = r"-1.5\baselineskip"
427
- else:
428
- insertions["imageheight"] = height * IMAGE_SHARE
429
- insertions["vspace"] = "1pt"
451
+ insertions["imageheight"], insertions["vspace"] = self.image_height_vspace(
452
+ thing, height
453
+ )
430
454
 
431
455
  # at first only portrait sign, landscape sign can be implemented later
432
456
  # if self.if_use_landscape_template(thing): # would need different condition
@@ -508,7 +532,6 @@ class SignPrinterLaTeX:
508
532
  program_missing.errno,
509
533
  f"Program {LATEXMK_OPTIONS[0]} missing.",
510
534
  program_missing.filename,
511
- program_missing.winerror,
512
535
  ) from program_missing
513
536
  else:
514
537
  raise program_missing
@@ -563,7 +586,6 @@ class SignPrinterLaTeX:
563
586
  program_missing.errno,
564
587
  f"Program {LATEXMK_OPTIONS[0]} missing.",
565
588
  program_missing.filename,
566
- program_missing.winerror,
567
589
  ) from program_missing
568
590
  else:
569
591
  raise program_missing
@@ -599,7 +621,6 @@ class SignPrinterLaTeX:
599
621
  program_missing.errno,
600
622
  "Program pdf2svg missing.",
601
623
  program_missing.filename,
602
- program_missing.winerror,
603
624
  ) from program_missing
604
625
  else:
605
626
  raise program_missing
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "flinventory"
3
- version = "0.6.6"
3
+ version = "0.6.9"
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