[26925] in Source-Commits
Re: /svn/athena r25835 - in trunk/debathena/config/printing-config:
daemon@ATHENA.MIT.EDU (Benjamin Kaduk)
Tue Mar 5 18:22:48 2013
Date: Tue, 5 Mar 2013 18:22:40 -0500 (EST)
From: Benjamin Kaduk <kaduk@MIT.EDU>
To: Jonathan D Reed <jdreed@MIT.EDU>
cc: source-commits@MIT.EDU
In-Reply-To: <201303051753.r25HrQtd019386@drugstore.mit.edu>
Message-ID: <alpine.GSO.1.10.1303051811560.9389@multics.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII
Appears to function as advertised, ACK.
I'm not sure I fully agree with commenting out tests for things we no
longer use, but on the other hand it's unclear how often the tests get run
anyway.
A couple comments inline.
On Tue, 5 Mar 2013, Jonathan D Reed wrote:
> Modified: trunk/debathena/config/printing-config/debathena/printing/lpr.py
> ===================================================================
> --- trunk/debathena/config/printing-config/debathena/printing/lpr.py 2013-03-05 17:08:07 UTC (rev 25834)
> +++ trunk/debathena/config/printing-config/debathena/printing/lpr.py 2013-03-05 17:53:26 UTC (rev 25835)
> @@ -16,50 +16,8 @@
>
> opts = {
> common.SYSTEM_CUPS: 'EH:U:P:#:hlmo:pqrC:J:T:',
> - common.SYSTEM_LPRNG: 'ABblC:D:F:Ghi:kJ:K:#:m:NP:rR:sT:U:Vw:X:YZ:z1:2:3:4:',
> }
>
> -
> -def translate_lprng_args_to_cups(args):
> - # TODO yell at user if/when we decide that these args are deprecated
A bit unfortunate that we did not do something about this TODO, I suppose.
> -
> - # If getopt fails, something went very wrong -- _we_ generated this
> - options, realargs = getopt.gnu_getopt(args, opts[common.SYSTEM_LPRNG])
> - cupsargs = []
> - for (o, a) in options:
> - if o in ('-b', '-l'):
> - cupsargs += [('-l', a)]
> - elif o in ('-h'):
> - cupsargs += [('-h', a)]
> - elif o in ('-J'):
> - cupsargs += [('-J', a)]
> - elif o in ('-K', '-#'):
> - cupsargs += [('-#', a)]
> - elif o in ('-P'):
> - cupsargs += [('-P', a)]
> - elif o in ('-T'):
> - cupsargs += [('-T', a)]
> - elif o in ('-U'):
> - cupsargs += [('-U', a)]
> - elif o in ('-Z'):
> - if a == 'simplex':
> - cupsargs += [('-o', 'sides=one-sided')]
> - elif a == 'duplex':
> - cupsargs += [('-o', 'sides=two-sided-long-edge')]
> - elif a == 'duplexshort':
> - cupsargs += [('-o', 'sides=two-sided-short-edge')]
> - # TODO attempt to deal banner=staff
> - elif o in ('-m'):
> - # Intentionally drop any argument to -m; zephyrs always go
> - # to you
> - cupsargs += [('-m', '')]
> - else:
> - sys.stderr.write("Warning: option %s%s not converted to CUPS\n"
> - % (o, a))
> - joincupsargs = [o + a for o, a in cupsargs] + realargs
> - return joincupsargs
> -
> -
> def _main(args):
> args.pop(0)
>
> @@ -78,15 +36,10 @@
> queue = queue_args[-1][-1]
>
> # Deal with zephyr notifications
> - zephyr_args, options = common.extract_opt(options, '-N')
> - if not zephyr_args and os.environ.get('ATHENA_USER'):
> + if os.environ.get('ATHENA_USER'):
> system = common.find_queue(queue)[0]
> - if argstyle == common.SYSTEM_LPRNG:
It looks like argstyle is perhaps unused now, though I did not make a
complete check. I guess there's not much value in asserting that it's
cups at this point.
> - options.append(('-m', 'zephyr%' + os.environ['ATHENA_USER']))
> - elif system == common.SYSTEM_CUPS:
> + if system == common.SYSTEM_CUPS:
> options.append(('-m', ''))
> - elif system == common.SYSTEM_LPRNG:
> - options.append(('-m', 'zephyr%' + os.environ['ATHENA_USER']))
>
> # Now that we've sliced up the arguments, put them back
> # together
> Modified: trunk/debathena/config/printing-config/debathena/printing/test_lpr.py
> ===================================================================
> --- trunk/debathena/config/printing-config/debathena/printing/test_lpr.py 2013-03-05 17:08:07 UTC (rev 25834)
> +++ trunk/debathena/config/printing-config/debathena/printing/test_lpr.py 2013-03-05 17:53:26 UTC (rev 25835)
>
> - # Result:
> - os.execvp('mit-lpr', ['lpr', '-Ujdreed', '-Pw20thesis', '-mzephyr%jdreed'])
> +# # Result:
> +# os.execvp('mit-lpr', ['lpr', '-Ujdreed', '-Pw20thesis'])
I'm not sure why -mzephyr%jdreed got removed as this was commented.
-Ben