feat: filter option parsing with tests
This commit is contained in:
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
"""CUPS filter for TA 3505ci - injects department account code into PostScript stream."""
|
||||
import sys
|
||||
|
||||
|
||||
def parse_options(options_str):
|
||||
options = {}
|
||||
for token in options_str.split():
|
||||
if '=' in token:
|
||||
k, v = token.split('=', 1)
|
||||
options[k] = v
|
||||
else:
|
||||
options[token] = 'true'
|
||||
return options
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
pass
|
||||
Reference in New Issue
Block a user