[25640] in Source-Commits
Re: /svn/athena r25135 - in trunk/debathena/config/printing-config:
daemon@ATHENA.MIT.EDU (Liz A. Denys)
Wed Jun 15 15:06:38 2011
Date: Wed, 15 Jun 2011 15:06:21 -0400 (EDT)
From: "Liz A. Denys" <lizdenys@MIT.EDU>
To: Jonathan D Reed <jdreed@mit.edu>
cc: source-commits@mit.edu
In-Reply-To: <201106141943.p5EJhcZU013620@drugstore.mit.edu>
Message-ID: <alpine.DEB.2.00.1106151506180.18895@taboo>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
ACK
--
Liz A. Denys
lizdenys@mit.edu
On Tue, 14 Jun 2011, Jonathan D Reed wrote:
> Date: Tue, 14 Jun 2011 15:43:38 -0400
> From: Jonathan D Reed <jdreed@MIT.EDU>
> To: source-commits@mit.edu
> Subject: /svn/athena r25135 - in trunk/debathena/config/printing-config:
> debathena/printing debian
>
> Author: jdreed
> Date: 2011-06-14 15:43:37 -0400 (Tue, 14 Jun 2011)
> New Revision: 25135
>
> Modified:
> trunk/debathena/config/printing-config/debathena/printing/simple.py
> trunk/debathena/config/printing-config/debian/changelog
> Log:
> In printing-config:
> * Don't barf on unexpected args (Trac #719)
>
>
> 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] ')
> + sys.exit(2)
> + argstyle, options, arguments = parseresult
>
> # Find the last queue specified in the arguments
> queue_args, options = common.extract_opt(options, queue_opt)
>
> Modified: trunk/debathena/config/printing-config/debian/changelog
> ===================================================================
> --- trunk/debathena/config/printing-config/debian/changelog 2011-06-14 17:02:14 UTC (rev 25134)
> +++ trunk/debathena/config/printing-config/debian/changelog 2011-06-14 19:43:37 UTC (rev 25135)
> @@ -1,3 +1,9 @@
> +debathena-printing-config (1.23.3) unstable; urgency=low
> +
> + * Don't barf on unexpected args (Trac #719)
> +
> + -- Jonathan Reed <jdreed@mit.edu> Tue, 14 Jun 2011 15:41:41 -0400
> +
> debathena-printing-config (1.23.2) unstable; urgency=low
>
> * Test system and argstyle, when adding zephyr args so as not to break
>
>