fix: use raw code without zero-padding, matching kyofilter_E behaviour

This commit is contained in:
Oliver Hofmann
2026-06-06 16:13:52 +02:00
parent bc0329861c
commit 50dec44d4a
3 changed files with 19 additions and 35 deletions
+2 -5
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
"""CUPS filter for TA 3505ci - injects department account code into PostScript stream."""
"""CUPS filter for TA 3505ci - injects department code into PostScript stream."""
import sys
@@ -21,10 +21,7 @@ def get_account_code(options):
code = km[2:]
if not code.isdigit():
return None
if len(code) > 8:
sys.stderr.write(f"kyofilter: WARNING: department code '{code}' exceeds 8 digits, ignored\n")
return None
return code.zfill(8)
return code # raw digits, no zero-padding — matches kyofilter_E behaviour
def process_stream(lines, account_code):