Show
Ignore:
Timestamp:
11/28/06 22:32:21 (18 years ago)
Author:
jerome
Message:

Now raises PyKotaToolError? when the error is not on the command line.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pknotify

    r3075 r3076  
    3838    hasPAM = 1 
    3939 
    40 from pykota.tool import Tool, PyKotaCommandLineError, crashed, N_ 
     40from pykota.tool import Tool, PyKotaToolError, PyKotaCommandLineError, crashed, N_ 
    4141 
    4242__doc__ = N_("""pknotify v%(__version__)s (c) %(__years__)s %(__author__)s 
     
    179179        """Checks if we could authenticate an username with a password.""" 
    180180        if not hasPAM :     
    181             raise PyKotaCommandLineError, _("You MUST install PyPAM for this functionnality to work !") 
     181            raise PyKotaToolError, _("You MUST install PyPAM for this functionnality to work !") 
    182182        else :     
    183183            retcode = False 
     
    298298                if errnum == errno.ECONNREFUSED : 
    299299                    self.printInfo(_("Are you sure that PyKotIcon is running and accepting incoming connections on %s:%s ?") % (self.destination, self.port), "error") 
    300             raise PyKotaCommandLineError, "%s : %s" % (_("Connection error"), str(msg)) 
     300            raise PyKotaToolError, "%s : %s" % (_("Connection error"), str(msg)) 
    301301        except TimeoutError, msg :     
    302302            self.printInfo(msg, "warn") 
     
    361361    except PyKotaCommandLineError, msg :     
    362362        sys.stderr.write("%s : %s\n" % (sys.argv[0], msg)) 
     363        print "CANCEL"  # Forces the cancellation of the print job if a command line switch is incorrect 
    363364        retcode = -2 
    364365    except SystemExit :