Skip to content
Snippets Groups Projects
Commit 8dc3915b authored by Lars Beckers's avatar Lars Beckers
Browse files

cups-client: add outputbin support to drucken.py

parent 71b1faef
Branches
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ import os ...@@ -4,7 +4,7 @@ import os
import subprocess import subprocess
## TODO time to print, job priority, mail on completion ## TODO time to print, job priority, mail on completion
## TODO input slot, resolution, OutputBin ## TODO input slot, resolution
## TODO lprm/cancel, lpq, lpstat, lpmove ## TODO lprm/cancel, lpq, lpstat, lpmove
parser = argparse.ArgumentParser(description="Skript zum Drucken in der Fachschaft.", epilog="See also: lprm, cancel, lpmove, lpq, lpstat") parser = argparse.ArgumentParser(description="Skript zum Drucken in der Fachschaft.", epilog="See also: lprm, cancel, lpmove, lpq, lpstat")
...@@ -15,10 +15,10 @@ group.add_argument("-d", "--duplex", action="store_true", help="Duplexfunktion e ...@@ -15,10 +15,10 @@ group.add_argument("-d", "--duplex", action="store_true", help="Duplexfunktion e
group.add_argument("--short-edge", action="store_true", help="Duplexfunktion (kurze Seite) explizit aktivieren") group.add_argument("--short-edge", action="store_true", help="Duplexfunktion (kurze Seite) explizit aktivieren")
group.add_argument("-s", "--single", action="store_true", help="Duplexfunktion explizit deaktivieren") group.add_argument("-s", "--single", action="store_true", help="Duplexfunktion explizit deaktivieren")
group = parser.add_mutually_exclusive_group() group = parser.add_mutually_exclusive_group()
group.add_argument("-H", "--hoern", action="store_true", help="Wähle den Kopierer in Raum 2014.") group.add_argument("-H", "--hoern", action="store_true", help="Wähle den Kopierer auf der Hörn.")
group.add_argument("-K", "--karman", action="store_true", help="Wähle den Kopierer in der Karmanstraße. (derzeit default)") group.add_argument("-K", "--karman", action="store_true", help="Wähle den Kopierer in der Karmanstraße. (derzeit default)")
group.add_argument("-O", "--other", action="store_true", help="Wähle den alten Drucker in Raum 2015.") #group.add_argument("-O", "--other", action="store_true", help="Wähle den alten Drucker in Raum 2015.")
group.add_argument("-C", "--cluster", action="store_true", help="Wähle den S/W-Druckercluster auf der Hörn.") #group.add_argument("-C", "--cluster", action="store_true", help="Wähle den S/W-Druckercluster auf der Hörn.")
parser.add_argument("-p", "--pages", help="Drucke nur bestimmte Seiten, z.B. 1-4,7") parser.add_argument("-p", "--pages", help="Drucke nur bestimmte Seiten, z.B. 1-4,7")
parser.add_argument("--remove", action="store_true", help="Lösche die Datei(n) nach dem Druck.") parser.add_argument("--remove", action="store_true", help="Lösche die Datei(n) nach dem Druck.")
parser.add_argument("--landscape", action="store_true", help="Im Querformat drucken.") parser.add_argument("--landscape", action="store_true", help="Im Querformat drucken.")
...@@ -29,7 +29,8 @@ parser.add_argument("--staple", choices=['None', 'Center', 'UpperLeft', 'UpperRi ...@@ -29,7 +29,8 @@ parser.add_argument("--staple", choices=['None', 'Center', 'UpperLeft', 'UpperRi
parser.add_argument("--punch", choices=['None', '2Hole', '2HoleEUR', '3Hole', '4Hole', '2', '3', '4'], default='None', help="Lochen. (Karman-only)") parser.add_argument("--punch", choices=['None', '2Hole', '2HoleEUR', '3Hole', '4Hole', '2', '3', '4'], default='None', help="Lochen. (Karman-only)")
parser.add_argument("--pages-per-page", choices=['1', '2', '4', '6', '9', '16'], default='1', help="Drucke n Seiten auf eine echte Seite. (default: %(default)s)") parser.add_argument("--pages-per-page", choices=['1', '2', '4', '6', '9', '16'], default='1', help="Drucke n Seiten auf eine echte Seite. (default: %(default)s)")
parser.add_argument("--media-type", choices=['Auto', 'Highqlty', 'Prepunched', 'Transparency', 'Bond', 'Labels', 'PrnDef', 'Cardstock', 'Letterhead', 'Recycled', 'Color', 'Plain', 'Rough', 'Envelope', 'Preprinted', 'Thick', 'Vellum'], help="Wähle das eingelegte Druckerpapier aus.") parser.add_argument("--media-type", choices=['Auto', 'Highqlty', 'Prepunched', 'Transparency', 'Bond', 'Labels', 'PrnDef', 'Cardstock', 'Letterhead', 'Recycled', 'Color', 'Plain', 'Rough', 'Envelope', 'Preprinted', 'Thick', 'Vellum'], help="Wähle das eingelegte Druckerpapier aus.")
parser.add_argument("--color", choices=['CMYK', 'Gray'], help="Wähle die Farbeinstellungen aus.") parser.add_argument("--color", choices=['CMYK', 'Gray'], help="Wähle die Farbeinstellungen aus. (Karman-only)")
parser.add_argument("--output-bin", choices=sorted(['FDStackerA', 'FDStackerC', 'INNERTRAY', 'MBDWN01', 'MBDWN03', 'MBDWN05', 'MBDWN07', 'SEPARATORTRAY', 'FDStackerB', 'FDTop', 'LFTTRAYDWN', 'MBDWN02', 'MBDWN04', 'MBDWN06', 'None', 'SEPARATORTRAYB']), default=None, help="Wähle das Ausgabefach aus. (Hörn kann nur FDTop und None; konkurriert ggf. mit Optionen wie Tackern und Lochen)")
group = parser.add_mutually_exclusive_group() group = parser.add_mutually_exclusive_group()
group.add_argument("--size", choices=['A3', 'A4', 'A5', 'A6'], help="Größe der Seiten festlegen. (A3 Karman-only)") group.add_argument("--size", choices=['A3', 'A4', 'A5', 'A6'], help="Größe der Seiten festlegen. (A3 Karman-only)")
group.add_argument("--custom-size", help="Benutzerdefinierte Größe der Seiten angeben (<Breite>x<Höhe>)") group.add_argument("--custom-size", help="Benutzerdefinierte Größe der Seiten angeben (<Breite>x<Höhe>)")
...@@ -61,10 +62,10 @@ if args.hoern: ...@@ -61,10 +62,10 @@ if args.hoern:
command += ["-o", "Duplex=DuplexNoTumble", "-o", "sides=two-sided-long-edge"] command += ["-o", "Duplex=DuplexNoTumble", "-o", "sides=two-sided-long-edge"]
if args.karman: if args.karman:
command += ["-P", "Kopierer"] command += ["-P", "Kopierer"]
if args.other: #if args.other:
command += ["-P", "Raum_Hoern"] # command += ["-P", "Raum_Hoern"]
if args.cluster: #if args.cluster:
command += ["-P", "Cluster_Hoern"] # command += ["-P", "Cluster_Hoern"]
if args.pages: if args.pages:
command += ["-o", "page-ranges="+args.pages] command += ["-o", "page-ranges="+args.pages]
if args.remove: if args.remove:
...@@ -76,7 +77,7 @@ if args.fitplot: ...@@ -76,7 +77,7 @@ if args.fitplot:
if args.scaling: if args.scaling:
command += ["-o", "scaling="+str(args.scaling)] command += ["-o", "scaling="+str(args.scaling)]
if args.staple: if args.staple:
if args.hoern or args.other: if args.hoern:# or args.other:
if args.staple != 'None': if args.staple != 'None':
parser.error("Die Drucker auf der Hörn können nicht tackern.") parser.error("Die Drucker auf der Hörn können nicht tackern.")
elif not args.karman: elif not args.karman:
...@@ -88,7 +89,7 @@ if args.staple: ...@@ -88,7 +89,7 @@ if args.staple:
else: else:
command += ["-o", "KCStaple="+args.staple] command += ["-o", "KCStaple="+args.staple]
if args.punch: if args.punch:
if args.hoern or args.other: if args.hoern:# or args.other:
if args.punch != 'None': if args.punch != 'None':
parser.error("Die Drucker auf der Hörn können nicht lochen.") parser.error("Die Drucker auf der Hörn können nicht lochen.")
elif not args.karman: elif not args.karman:
...@@ -102,7 +103,7 @@ if args.punch: ...@@ -102,7 +103,7 @@ if args.punch:
punch_option += "EUR" punch_option += "EUR"
command += ["-o", "KCPunch=" + punch_option] command += ["-o", "KCPunch=" + punch_option]
if args.size: if args.size:
if (args.hoern or args.other) and args.size == 'A3': if args.hoern and args.size == 'A3':# or args.other
parser.error("Die Drucker auf der Hörn können nicht in A3 drucken.") parser.error("Die Drucker auf der Hörn können nicht in A3 drucken.")
elif args.size == 'A3' and not args.karman: elif args.size == 'A3' and not args.karman:
command += ["-P", "Kopierer"] command += ["-P", "Kopierer"]
...@@ -117,6 +118,10 @@ if args.media_type: ...@@ -117,6 +118,10 @@ if args.media_type:
command += ["-o", "MediaType="+args.media_type] command += ["-o", "MediaType="+args.media_type]
if args.color: if args.color:
command += ["-o", "ColorModel="+args.color] command += ["-o", "ColorModel="+args.color]
if args.output_bin:
if not args.karman and args.output_bin not in ['FDTop', 'None']:
parser.error('Der Kopierer auf der Hörn unterstützt nur die Ausgabefächer FDTop und None.')
command += ["-o", "OutputBin="+args.output_bin]
if args.landscape: if args.landscape:
command += ["-o", "landscape"] command += ["-o", "landscape"]
if args.pages_per_page and args.pages_per_page != '1': if args.pages_per_page and args.pages_per_page != '1':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment