[25647] in Source-Commits
Re: /svn/athena r25135 - in trunk/debathena/config/printing-config:
daemon@ATHENA.MIT.EDU (Benjamin Kaduk)
Fri Jun 17 02:03:16 2011
Date: Fri, 17 Jun 2011 02:03:07 -0400 (EDT)
From: Benjamin Kaduk <kaduk@MIT.EDU>
To: Jonathan D Reed <jdreed@MIT.EDU>
cc: source-commits@MIT.EDU
In-Reply-To: <alpine.DEB.2.00.1106151506180.18895@taboo>
Message-ID: <alpine.GSO.1.10.1106170202210.6818@multics.mit.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
On Wed, 15 Jun 2011, Liz A. Denys wrote:
> ACK
>
> --
> Liz A. Denys
> lizdenys@mit.edu
>
> On Tue, 14 Jun 2011, Jonathan D Reed wrote:
>
>>
>> Modified:
>> trunk/debathena/config/printing-config/debathena/printing/simple.py
>> ===================================================================
>> --- trunk/debathena/config/printing-config/debathena/printing/simple.py
>> 2011-06-14 17:02:14 UTC (rev 25134)
>> +++ trunk/debathena/config/printing-config/debathena/printing/simple.py
>> 2011-06-14 19:43:37 UTC (rev 25135)
>> @@ -10,6 +10,8 @@
>>
>> import os
>> import sys
>> +import string
>> +import re
>>
>> from debathena.printing import common
>>
>> @@ -19,7 +21,15 @@
>>
>> queue = common.get_default_printer()
>> try:
>> - argstyle, options, arguments = common.parse_args(args, optinfo)
>> + parseresult = common.parse_args(args, optinfo)
>> + if parseresult == None:
>> + # Don't barf if neither CUPS nor LPRng syntax was valid (and
>> + # hence parse_args returns None)
>> + # Remove this stupidity when we kill LPRng with fire
>> + print "Syntax Error: Incorrect option passed."
>> + print "Valid options: " +
>> string.replace(re.sub(r'([a-zA-Z])',r'-\1
>> ',optinfo[common.SYSTEM_CUPS][1]), ':', '[arg] ')
Anyone mind if I break the long line?
-Ben
>> + sys.exit(2)
>> + argstyle, options, arguments = parseresult
>>
>> # Find the last queue specified in the arguments
>> queue_args, options = common.extract_opt(options, queue_opt)
>>