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

Better dispatching of error messages

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • 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