Show
Ignore:
Timestamp:
09/27/05 20:34:31 (19 years ago)
Author:
jerome
Message:

Ensure that human made errors (like incorrect command line options)
don't produce a traceback anymore. No need to frighten users with
such complete tracebacks and email reporting each time they mistype
some command.
Makes pykosd check more carefully the values of its command line options.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pykotme

    r2352 r2512  
    2929import pwd 
    3030 
    31 from pykota.tool import PyKotaTool, PyKotaToolError, crashed, N_ 
     31from pykota.tool import PyKotaTool, PyKotaToolError, PyKotaCommandLineError, crashed, N_ 
    3232 
    3333try : 
     
    9696        printers = self.storage.getMatchingPrinters(options["printer"]) 
    9797        if not printers : 
    98             raise PyKotaToolError, _("There's no printer matching %s") % options["printer"] 
     98            raise PyKotaCommandLineError, _("There's no printer matching %s") % options["printer"] 
    9999             
    100100        username = pwd.getpwuid(os.getuid())[0] 
     
    140140    except KeyboardInterrupt :         
    141141        sys.stderr.write("\nInterrupted with Ctrl+C !\n") 
     142    except PyKotaCommandLineError, msg :     
     143        sys.stderr.write("%s : %s\n" % (sys.argv[0], msg)) 
    142144    except SystemExit :         
    143145        pass