diff --git a/cups-client/files/drucken.py b/cups-client/files/drucken.py index 781974ea8fb8a9559f405a8c0c47e5f2463154c5..d48d1c23f0ce6ca02cf2930e11aac5d9681b06c8 100755 --- a/cups-client/files/drucken.py +++ b/cups-client/files/drucken.py @@ -4,7 +4,7 @@ import os import subprocess ## TODO time to print, job priority, mail on completion -## TODO input slot, resolution, OutputBin +## TODO input slot, resolution ## TODO lprm/cancel, lpq, lpstat, lpmove 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 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 = 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("-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("-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.") 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("--landscape", action="store_true", help="Im Querformat drucken.") @@ -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("--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("--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.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>)") @@ -61,10 +62,10 @@ if args.hoern: command += ["-o", "Duplex=DuplexNoTumble", "-o", "sides=two-sided-long-edge"] if args.karman: command += ["-P", "Kopierer"] -if args.other: - command += ["-P", "Raum_Hoern"] -if args.cluster: - command += ["-P", "Cluster_Hoern"] +#if args.other: +# command += ["-P", "Raum_Hoern"] +#if args.cluster: +# command += ["-P", "Cluster_Hoern"] if args.pages: command += ["-o", "page-ranges="+args.pages] if args.remove: @@ -76,7 +77,7 @@ if args.fitplot: if args.scaling: command += ["-o", "scaling="+str(args.scaling)] if args.staple: - if args.hoern or args.other: + if args.hoern:# or args.other: if args.staple != 'None': parser.error("Die Drucker auf der Hörn können nicht tackern.") elif not args.karman: @@ -88,7 +89,7 @@ if args.staple: else: command += ["-o", "KCStaple="+args.staple] if args.punch: - if args.hoern or args.other: + if args.hoern:# or args.other: if args.punch != 'None': parser.error("Die Drucker auf der Hörn können nicht lochen.") elif not args.karman: @@ -102,7 +103,7 @@ if args.punch: punch_option += "EUR" command += ["-o", "KCPunch=" + punch_option] 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.") elif args.size == 'A3' and not args.karman: command += ["-P", "Kopierer"] @@ -117,6 +118,10 @@ if args.media_type: command += ["-o", "MediaType="+args.media_type] if 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: command += ["-o", "landscape"] if args.pages_per_page and args.pages_per_page != '1':