Changeset 1584

Show
Ignore:
Timestamp:
07/01/04 21:56:43 (20 years ago)
Author:
jalet
Message:

Better dispatching of error messages

Location:
pykota/trunk
Files:
11 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r1562 r1584  
    2424# 
    2525# $Log$ 
     26# Revision 1.66  2004/07/01 19:56:25  jalet 
     27# Better dispatching of error messages 
     28# 
    2629# Revision 1.65  2004/06/22 09:31:17  jalet 
    2730# Always send some debug info to CUPS' back channel stream (stderr) as 
     
    381384            # we deny the job in this case (nothing to print anyway) 
    382385            if not self.jobSizeBytes : 
    383                 self.logger.log_message(_("Job contains no data. Printing is denied."), "warn") 
     386                self.printInfo(_("Job contains no data. Printing is denied."), "warn") 
    384387                action = "DENY" 
    385388             
     
    446449            pollobj.unregister(fileno) 
    447450        except KeyError :     
    448             self.logger.log_message(_("File number %s unregistered twice from polling object, ignored.") % fileno, "warn") 
     451            self.printInfo(_("File number %s unregistered twice from polling object, ignored.") % fileno, "warn") 
    449452        except :     
    450453            self.logdebug("Error while unregistering file number %s from polling object." % fileno) 
     
    471474    def sendBackChannelData(self, message) :     
    472475        """Sends an informational message to CUPS via back channel stream (stderr).""" 
    473         sys.stderr.write("INFO: PyKota (PID %s) : %s\n" % (os.getpid(), message.strip())) 
    474         sys.stderr.flush() 
     476        self.printInfo("PyKota (PID %s) : %s" % (os.getpid(), message.strip())) 
    475477         
    476478    def handleData(self) :                     
     
    651653            retcode = os.WEXITSTATUS(status) 
    652654        elif not killed :     
    653             self.logger.log_message(_("CUPS backend %s died abnormally.") % realbackend, "error") 
     655            self.printInfo(_("CUPS backend %s died abnormally.") % realbackend, "error") 
    654656            retcode = -1 
    655657        else :     
  • pykota/trunk/bin/edpykota

    r1546 r1584  
    2424# 
    2525# $Log$ 
     26# Revision 1.76  2004/07/01 19:56:40  jalet 
     27# Better dispatching of error messages 
     28# 
    2629# Revision 1.75  2004/06/18 13:34:47  jalet 
    2730# Now all tracebacks include PyKota's version number 
     
    463466            if (softlimit is not None) and (hardlimit is not None) and (hardlimit < softlimit) :         
    464467                # error, exchange them 
    465                 self.logger.log_message(_("Hard limit %i is less than soft limit %i, values will be exchanged.") % (hardlimit, softlimit)) 
     468                self.printInfo(_("Hard limit %i is less than soft limit %i, values will be exchanged.") % (hardlimit, softlimit)) 
    466469                (softlimit, hardlimit) = (hardlimit, softlimit) 
    467470             
     
    541544                    protoquota = getattr(self.storage, "get%sPQuota" % suffix)(protoentry, printer) 
    542545                    if not protoquota.Exists : 
    543                         self.logger.log_message(_("Prototype %s not found in Quota Storage for printer %s.") % (protoentry.Name, printer.Name)) 
     546                        self.printInfo(_("Prototype %s not found in Quota Storage for printer %s.") % (protoentry.Name, printer.Name)) 
    544547                        continue    # skip this printer 
    545548                    else :     
    546549                        (softlimit, hardlimit) = (protoquota.SoftLimit, protoquota.HardLimit) 
    547550                else :         
    548                     self.logger.log_message(_("Prototype object %s not found in Quota Storage.") % protoentry.Name) 
     551                    self.printInfo(_("Prototype object %s not found in Quota Storage.") % protoentry.Name) 
    549552                     
    550553            if not options["noquota"] :     
     
    552555                    hardlimit = softlimit 
    553556                    if hardlimit is not None : 
    554                         self.logger.log_message(_("Undefined hard limit set to soft limit (%s) on printer %s.") % (str(hardlimit), printer.Name)) 
     557                        self.printInfo(_("Undefined hard limit set to soft limit (%s) on printer %s.") % (str(hardlimit), printer.Name)) 
    555558                if softlimit is None :     
    556559                    softlimit = hardlimit 
    557560                    if softlimit is not None : 
    558                         self.logger.log_message(_("Undefined soft limit set to hard limit (%s) on printer %s.") % (str(softlimit), printer.Name)) 
     561                        self.printInfo(_("Undefined soft limit set to hard limit (%s) on printer %s.") % (str(softlimit), printer.Name)) 
    559562                         
    560563            if options["add"] :     
     
    568571                        (name, email) = splitname 
    569572                        if email and (email.count('@') != 1) : 
    570                             self.logger.log_message(_("Invalid email address %s") % email) 
     573                            self.printInfo(_("Invalid email address %s") % email) 
    571574                            email = "" 
    572575                    entry = getattr(self.storage, "get%s" % suffix)(name) 
     
    595598                        else :     
    596599                            if options["groups"] : 
    597                                 self.logger.log_message(_("Invalid group name %s") % entry.Name) 
     600                                self.printInfo(_("Invalid group name %s") % entry.Name) 
    598601                            else :     
    599                                 self.logger.log_message(_("Invalid user name %s") % entry.Name) 
     602                                self.printInfo(_("Invalid user name %s") % entry.Name) 
    600603                elif options["delete"] :                 
    601604                    todelete[entry.Name] = entry 
     
    607610                         
    608611                if not entrypquota.Exists :      
    609                     self.logger.log_message(_("Quota not found for object %s on printer %s.") % (entry.Name, printer.Name)) 
     612                    self.printInfo(_("Quota not found for object %s on printer %s.") % (entry.Name, printer.Name)) 
    610613                else :     
    611614                    if options["noquota"] or options["prototype"] or ((softlimit is not None) and (hardlimit is not None)) : 
     
    640643                                    changed[entry.Name]["ingroups"].append(groupname) 
    641644                                else : 
    642                                     self.logger.log_message(_("Group %s not found in the PyKota Storage.") % groupname) 
     645                                    self.printInfo(_("Group %s not found in the PyKota Storage.") % groupname) 
    643646                                     
    644647                    # This line disabled to prevent sending of unwanted email                  
  • pykota/trunk/bin/pkhint

    r1579 r1584  
    2424# 
    2525# $Log$ 
     26# Revision 1.14  2004/07/01 19:56:40  jalet 
     27# Better dispatching of error messages 
     28# 
    2629# Revision 1.13  2004/06/29 07:55:18  jalet 
    2730# Doesn't output the warning message when --help or --version is asked 
     
    226229                device = self.extractDeviceFromURI(deviceuri) 
    227230                if devicetype is None : 
    228                     sys.stderr.write("Unknown device %s for printer %s\n" % (device, printer)) 
     231                    self.printInfo(_("Unknown device %s for printer %s") % (device, printer)) 
    229232                elif devicetype == "network" : 
    230233                    try : 
     
    245248                        else :     
    246249                            configuration.append((printer, "software(/usr/bin/pkpgcounter)")) 
    247                 # elif devicetype == "direct" :  
    248                 #    sys.stderr.write("Can't currently handle device %s for printer %s\n" % (device, printer)) 
    249                 #elif devicetype == "serial" :  
    250                 #    sys.stderr.write("Can't currently handle device %s for printer %s\n" % (device, printer)) 
    251                 #else : 
    252                 #    sys.stderr.write("Can't currently handle device %s for printer %s\n" % (device, printer)) 
    253250                else : 
    254251                    configuration.append((printer, "software(/usr/bin/pkpgcounter)")) 
  • pykota/trunk/bin/pkprinters

    r1582 r1584  
    2424# 
    2525# $Log$ 
     26# Revision 1.13  2004/07/01 19:56:41  jalet 
     27# Better dispatching of error messages 
     28# 
    2629# Revision 1.12  2004/07/01 17:45:47  jalet 
    2730# Added code to handle the description field for printers 
     
    197200                if printer.Exists : 
    198201                    if options["skipexisting"] : 
    199                         self.printError(_("Printer %s already exists, skipping.") % printer.Name) 
     202                        self.printInfo(_("Printer %s already exists, skipping.") % printer.Name) 
    200203                    else :     
    201                         self.printError(_("Printer %s already exists, will be modified.") % printer.Name) 
     204                        self.printInfo(_("Printer %s already exists, will be modified.") % printer.Name) 
    202205                        printers.append(printer) 
    203206                else : 
  • pykota/trunk/bin/pykotme

    r1546 r1584  
    2424# 
    2525# $Log$ 
     26# Revision 1.13  2004/07/01 19:56:42  jalet 
     27# Better dispatching of error messages 
     28# 
    2629# Revision 1.12  2004/06/18 13:34:49  jalet 
    2730# Now all tracebacks include PyKota's version number 
     
    151154                totalsize += parser.getJobSize() 
    152155            except PDLAnalyzerError, msg :     
    153                 sys.stderr.write("%s\n" % msg) 
    154                 sys.stderr.flush() 
     156                self.printInfo(msg) 
    155157             
    156158        # get current user 
  • pykota/trunk/NEWS

    r1582 r1584  
    2222PyKota NEWS : 
    2323 
     24    - 1.19alpha29 :  
     25     
     26        - Correctly dispatches error messages depending on the 
     27          situation : tools which can be run interactively will 
     28          ALWAYS output their logs to stderr, excepted for 
     29          their DEBUG messages, for which the "logger:" 
     30          directive as set in pykota.conf will be honored. 
     31          Tools which can't be run interactively will ALWAYS 
     32          honor the "logger:" directive as set in pykota.conf 
     33           
    2434    - 1.19alpha28 : 
    2535     
  • pykota/trunk/pykota/accounters/hardware.py

    r1536 r1584  
    2222# 
    2323# $Log$ 
     24# Revision 1.6  2004/07/01 19:56:42  jalet 
     25# Better dispatching of error messages 
     26# 
    2427# Revision 1.5  2004/06/10 22:42:06  jalet 
    2528# Better messages in logs 
     
    6063            # can't get actual page counter, assume printer is off or warming up 
    6164            # log the message anyway. 
    62             self.filter.logger.log_message("%s" % msg, "warn") 
     65            self.filter.printInfo("%s" % msg, "warn") 
    6366            counter = None 
    6467        self.filter.logdebug("Printer's internal page counter value is : %s" % str(counter)) 
     
    106109        if printer is None : 
    107110            raise PyKotaAccounterError, _("Unknown printer address in HARDWARE(%s) for printer %s") % (commandline, self.filter.printername) 
    108         self.filter.logger.log_message(_("Launching HARDWARE(%s)...") % commandline, "info") 
     111        self.filter.printInfo(_("Launching HARDWARE(%s)...") % commandline) 
    109112        error = 1 
    110113        pagecounter = None 
     
    114117            pagecounter = int(line.strip()) 
    115118        except ValueError :     
    116             self.filter.logger.log_message(_("Incorrect answer : %s") % repr(line), "error") 
     119            self.filter.printInfo(_("Incorrect answer : %s") % repr(line), "error") 
    117120        except IOError :     
    118121            # we were interrupted by a signal, certainely a SIGTERM 
     
    122125            except :     
    123126                pass # already killed ? 
    124             self.filter.logger.log_message(_("SIGTERM was sent to hardware accounter %s (pid: %s)") % (commandline, child.pid), "info") 
     127            self.filter.printInfo(_("SIGTERM was sent to hardware accounter %s (pid: %s)") % (commandline, child.pid)) 
    125128        else :     
    126129            error = 0 
  • pykota/trunk/pykota/accounters/software.py

    r1536 r1584  
    2222# 
    2323# $Log$ 
     24# Revision 1.6  2004/07/01 19:56:43  jalet 
     25# Better dispatching of error messages 
     26# 
    2427# Revision 1.5  2004/06/10 22:42:06  jalet 
    2528# Better messages in logs 
     
    4952    def computeJobSize(self) :     
    5053        """Feeds an external command with our datas to let it compute the job size, and return its value.""" 
    51         self.filter.logger.log_message(_("Launching SOFTWARE(%s)...") % self.arguments, "info") 
     54        self.filter.printInfo(_("Launching SOFTWARE(%s)...") % self.arguments) 
    5255        MEGABYTE = 1024*1024 
    5356        self.filter.jobdatastream.seek(0) 
     
    6265        except (IOError, OSError), msg :     
    6366            msg = "%s : %s" % (self.arguments, msg)  
    64             self.filter.logger.log_message(_("Unable to compute job size with accounter %s") % msg) 
     67            self.filter.printInfo(_("Unable to compute job size with accounter %s") % msg) 
    6568         
    6669        pagecount = 0 
     
    6871            pagecount = int(child.fromchild.readline().strip()) 
    6972        except (AttributeError, ValueError) : 
    70             self.filter.logger.log_message(_("Unable to compute job size with accounter %s") % self.arguments) 
     73            self.filter.printInfo(_("Unable to compute job size with accounter %s") % self.arguments) 
    7174        except (IOError, OSError), msg :     
    7275            msg = "%s : %s" % (self.arguments, msg)  
    73             self.filter.logger.log_message(_("Unable to compute job size with accounter %s") % msg) 
     76            self.filter.printInfo(_("Unable to compute job size with accounter %s") % msg) 
    7477        child.fromchild.close() 
    7578         
     
    7780            retcode = child.wait() 
    7881        except OSError, msg :     
    79             self.filter.logger.log_message(_("Problem while waiting for software accounter pid %s to exit : %s") % (child.pid, msg)) 
     82            self.filter.printInfo(_("Problem while waiting for software accounter pid %s to exit : %s") % (child.pid, msg)) 
    8083        else :     
    8184            if os.WIFEXITED(retcode) : 
     
    8386            else :     
    8487                status = retcode 
    85             self.filter.logger.log_message(_("Software accounter %s exit code is %s") % (self.arguments, repr(retcode))) 
     88            self.filter.printInfo(_("Software accounter %s exit code is %s") % (self.arguments, repr(retcode))) 
    8689        self.filter.logdebug("Software accounter %s said job is %s pages long." % (self.arguments, pagecount)) 
    8790        return pagecount     
  • pykota/trunk/pykota/storages/ldapstorage.py

    r1582 r1584  
    2222# 
    2323# $Log$ 
     24# Revision 1.72  2004/07/01 19:56:43  jalet 
     25# Better dispatching of error messages 
     26# 
    2427# Revision 1.71  2004/07/01 17:45:49  jalet 
    2528# Added code to handle the description field for printers 
     
    805808                message = _("Unable to find an existing objectClass %s entry with %s=%s to attach pykotaAccount objectClass") % (where, self.info["userrdn"], user.Name) 
    806809                if action.lower() == "warn" :     
    807                     self.tool.logger.log_message("%s. A new entry will be created instead." % message, "warn") 
     810                    self.tool.printInfo("%s. A new entry will be created instead." % message, "warn") 
    808811                else : # 'fail' or incorrect setting 
    809812                    raise PyKotaStorageError, "%s. Action aborted. Please check your configuration." % message 
     
    841844                message = _("Unable to find an existing entry to attach pykotaGroup objectclass %s") % group.Name 
    842845                if action.lower() == "warn" :     
    843                     self.tool.logger.log_message("%s. A new entry will be created instead." % message, "warn") 
     846                    self.tool.printInfo("%s. A new entry will be created instead." % message, "warn") 
    844847                else : # 'fail' or incorrect setting 
    845848                    raise PyKotaStorageError, "%s. Action aborted. Please check your configuration." % message 
  • pykota/trunk/pykota/tool.py

    r1582 r1584  
    2222# 
    2323# $Log$ 
     24# Revision 1.110  2004/07/01 19:56:42  jalet 
     25# Better dispatching of error messages 
     26# 
    2427# Revision 1.109  2004/07/01 17:45:49  jalet 
    2528# Added code to handle the description field for printers 
     
    451454        except (locale.Error, IOError) : 
    452455            gettext.NullTranslations().install() 
    453             # sys.stderr.write("PyKota : Error while loading translations\n") 
    454456     
    455457        # pykota specific stuff 
     
    479481            self.logger.log_message(message, "debug") 
    480482             
    481     def printError(self, message) :         
     483    def printInfo(self, message, level="info") :         
    482484        """Sends a message to standard error.""" 
    483         sys.stderr.write("%s\n" % message) 
     485        sys.stderr.write("%s: %s\n" % (level.upper(), message)) 
    484486        sys.stderr.flush() 
    485487         
     
    577579                self.display_usage_and_quit() 
    578580        except getopt.error, msg : 
    579             sys.stderr.write("%s\n" % msg) 
    580             sys.stderr.flush() 
     581            self.printInfo(msg) 
    581582            self.display_usage_and_quit() 
    582583        return (parsed, args) 
     
    607608            server = smtplib.SMTP(self.smtpserver) 
    608609        except socket.error, msg :     
    609             self.logger.log_message(_("Impossible to connect to SMTP server : %s") % msg, "error") 
     610            self.printInfo(_("Impossible to connect to SMTP server : %s") % msg, "error") 
    610611        else : 
    611612            try : 
     
    613614            except smtplib.SMTPException, answer :     
    614615                for (k, v) in answer.recipients.items() : 
    615                     self.logger.log_message(_("Impossible to send mail to %s, error %s : %s") % (k, v[0], v[1]), "error") 
     616                    self.printInfo(_("Impossible to send mail to %s, error %s : %s") % (k, v[0], v[1]), "error") 
    616617            server.quit() 
    617618         
     
    640641            else :     
    641642                action = "POLICY_DENY" 
    642             self.logger.log_message(_("Unable to match user %s on printer %s, applying default policy (%s)") % (user.Name, printer.Name, action)) 
     643            self.printInfo(_("Unable to match user %s on printer %s, applying default policy (%s)") % (user.Name, printer.Name, action)) 
    643644        else :     
    644645            pagecounter = int(userpquota.PageCounter or 0) 
     
    769770                else :     
    770771                    action = "POLICY_DENY" 
    771                 self.logger.log_message(_("Unable to find user %s's account balance, applying default policy (%s) for printer %s") % (user.Name, action, printer.Name)) 
     772                self.printInfo(_("Unable to find user %s's account balance, applying default policy (%s) for printer %s") % (user.Name, action, printer.Name)) 
    772773                return action         
    773774            else :     
     
    830831        if action == "DENY" : 
    831832            adminmessage = _("Print Quota exceeded for group %s on printer %s") % (group.Name, printer.Name) 
    832             self.logger.log_message(adminmessage) 
     833            self.printInfo(adminmessage) 
    833834            if mailto in [ "BOTH", "ADMIN" ] : 
    834835                self.sendMessageToAdmin(adminmail, _("Print Quota"), adminmessage) 
     
    841842        elif action == "WARN" :     
    842843            adminmessage = _("Print Quota low for group %s on printer %s") % (group.Name, printer.Name) 
    843             self.logger.log_message(adminmessage) 
     844            self.printInfo(adminmessage) 
    844845            if mailto in [ "BOTH", "ADMIN" ] : 
    845846                self.sendMessageToAdmin(adminmail, _("Print Quota"), adminmessage) 
     
    868869        if action == "DENY" : 
    869870            adminmessage = _("Print Quota exceeded for user %s on printer %s") % (user.Name, printer.Name) 
    870             self.logger.log_message(adminmessage) 
     871            self.printInfo(adminmessage) 
    871872            if mailto in [ "BOTH", "USER", "EXTERNAL" ] : 
    872873                message = self.config.getHardWarn(printer.Name) 
     
    879880        elif action == "WARN" :     
    880881            adminmessage = _("Print Quota low for user %s on printer %s") % (user.Name, printer.Name) 
    881             self.logger.log_message(adminmessage) 
     882            self.printInfo(adminmessage) 
    882883            if mailto in [ "BOTH", "USER", "EXTERNAL" ] : 
    883884                if user.LimitBy and (user.LimitBy.lower() == "balance") :  
     
    980981            # computation is just an indication of what the 
    981982            # job's size MAY be. 
    982             self.logger.log_message(_("Unable to precompute the job's size with the generic PDL analyzer : %s") % msg, "warn") 
     983            self.printInfo(_("Unable to precompute the job's size with the generic PDL analyzer : %s") % msg, "warn") 
    983984            return 0 
    984985        else :     
     
    994995        self.gotSigTerm = 1 
    995996        os.environ["PYKOTASTATUS"] = "CANCELLED" 
    996         self.logger.log_message(_("SIGTERM received, job %s cancelled.") % self.jobid, "info") 
     997        self.printInfo(_("SIGTERM received, job %s cancelled.") % self.jobid) 
    997998         
    998999    def exportJobInfo(self) :     
     
    10351036            self.logdebug("Executing post-hook [%s]" % posthook) 
    10361037            os.system(posthook) 
     1038         
     1039    def printInfo(self, message, level="info") :         
     1040        """Sends a message to standard error.""" 
     1041        self.logger.log_message("%s" % message, level) 
    10371042         
    10381043    def extractInfoFromCupsOrLprng(self) :     
     
    10981103                Kseen = 1       # we assume the user wants at least one copy... 
    10991104            if (rseen is None) and jseen and Pseen and nseen :     
    1100                 self.logger.log_message(_("Printer hostname undefined, set to 'localhost'"), "warn") 
     1105                self.printInfo(_("Printer hostname undefined, set to 'localhost'"), "warn") 
    11011106                rseen = "localhost" 
    11021107            if jseen and Pseen and nseen and rseen :         
    11031108                # job is always in stdin (None) 
    11041109                return ("LPRNG", rseen, Pseen, nseen, jseen, None, Kseen, None, None, None) 
    1105         self.logger.log_message(_("Printing system unknown, args=%s") % " ".join(sys.argv), "warn") 
     1110        self.printInfo(_("Printing system unknown, args=%s") % " ".join(sys.argv), "warn") 
    11061111        return (None, None, None, None, None, None, None, None, None, None)   # Unknown printing system 
    11071112         
     
    11341139                commandline = self.formatCommandLine(args, user, printer) 
    11351140                if not printer.Exists : 
    1136                     self.logger.log_message(_("Printer %s not registered in the PyKota system, applying external policy (%s) for printer %s") % (self.printername, commandline, self.printername), "info") 
     1141                    self.printInfo(_("Printer %s not registered in the PyKota system, applying external policy (%s) for printer %s") % (self.printername, commandline, self.printername)) 
    11371142                if not user.Exists : 
    1138                     self.logger.log_message(_("User %s not registered in the PyKota system, applying external policy (%s) for printer %s") % (self.username, commandline, self.printername), "info") 
     1143                    self.printInfo(_("User %s not registered in the PyKota system, applying external policy (%s) for printer %s") % (self.username, commandline, self.printername)) 
    11391144                if not userpquota.Exists : 
    1140                     self.logger.log_message(_("User %s doesn't have quota on printer %s in the PyKota system, applying external policy (%s) for printer %s") % (self.username, self.printername, commandline, self.printername), "info") 
     1145                    self.printInfo(_("User %s doesn't have quota on printer %s in the PyKota system, applying external policy (%s) for printer %s") % (self.username, self.printername, commandline, self.printername)) 
    11411146                if os.system(commandline) : 
    1142                     self.logger.log_message(_("External policy %s for printer %s produced an error. Job rejected. Please check PyKota's configuration files.") % (commandline, self.printername), "error") 
     1147                    self.printInfo(_("External policy %s for printer %s produced an error. Job rejected. Please check PyKota's configuration files.") % (commandline, self.printername), "error") 
    11431148                    policy = "EXTERNALERROR" 
    11441149                    break 
    11451150            else :         
    11461151                if not printer.Exists : 
    1147                     self.logger.log_message(_("Printer %s not registered in the PyKota system, applying default policy (%s)") % (self.printername, policy), "info") 
     1152                    self.printInfo(_("Printer %s not registered in the PyKota system, applying default policy (%s)") % (self.printername, policy)) 
    11481153                if not user.Exists : 
    1149                     self.logger.log_message(_("User %s not registered in the PyKota system, applying default policy (%s) for printer %s") % (self.username, policy, self.printername), "info") 
     1154                    self.printInfo(_("User %s not registered in the PyKota system, applying default policy (%s) for printer %s") % (self.username, policy, self.printername)) 
    11501155                if not userpquota.Exists : 
    1151                     self.logger.log_message(_("User %s doesn't have quota on printer %s in the PyKota system, applying default policy (%s)") % (self.username, self.printername, policy), "info") 
     1156                    self.printInfo(_("User %s doesn't have quota on printer %s in the PyKota system, applying default policy (%s)") % (self.username, self.printername, policy)) 
    11521157                break 
    11531158        if policy == "EXTERNAL" :     
    11541159            if not printer.Exists : 
    1155                 self.logger.log_message(_("Printer %s still not registered in the PyKota system, job will be rejected") % self.printername, "info") 
     1160                self.printInfo(_("Printer %s still not registered in the PyKota system, job will be rejected") % self.printername) 
    11561161            if not user.Exists : 
    1157                 self.logger.log_message(_("User %s still not registered in the PyKota system, job will be rejected on printer %s") % (self.username, self.printername), "info") 
     1162                self.printInfo(_("User %s still not registered in the PyKota system, job will be rejected on printer %s") % (self.username, self.printername)) 
    11581163            if not userpquota.Exists : 
    1159                 self.logger.log_message(_("User %s still doesn't have quota on printer %s in the PyKota system, job will be rejected") % (self.username, self.printername), "info") 
     1164                self.printInfo(_("User %s still doesn't have quota on printer %s in the PyKota system, job will be rejected") % (self.username, self.printername)) 
    11601165        return (policy, printer, user, userpquota) 
    11611166         
     
    11771182        else : 
    11781183            if policy not in ("OK", "ALLOW") : 
    1179                 self.logger.log_message(_("Invalid policy %s for printer %s") % (policy, self.printername)) 
     1184                self.printInfo(_("Invalid policy %s for printer %s") % (policy, self.printername)) 
    11801185                return self.removeJob() 
    11811186            else : 
  • pykota/trunk/pykota/version.py

    r1575 r1584  
    2222# 
    2323 
    24 __version__ = "1.19alpha28_unofficial" 
     24__version__ = "1.19alpha29_unofficial" 
    2525 
    2626__doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""