Changeset 2524 for pykota/trunk/bin

Show
Ignore:
Timestamp:
09/29/05 13:39:17 (19 years ago)
Author:
jerome
Message:

More complete output for pykotme

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/pykotme

    r2512 r2524  
    105105        print _("Job size : %i pages") % totalsize     
    106106        if user.Exists : 
    107             for printer in printers : 
    108                 userpquota = self.storage.getUserPQuota(user, printer) 
    109                 if userpquota.Exists : 
    110                     cost = userpquota.computeJobPrice(totalsize) 
    111                     print _("Cost on printer %s : %.2f") % (printer.Name, cost) 
     107            if user.LimitBy == "noprint" : 
     108                print _("Your account settings forbid you to print at this time.") 
     109            else :     
     110                for printer in printers : 
     111                    userpquota = self.storage.getUserPQuota(user, printer) 
     112                    if userpquota.Exists : 
     113                        if printer.MaxJobSize and (totalsize > printer.MaxJobSize) : 
     114                            print _("You are not allowed to print so many pages on printer %s at this time.") % printer.Name 
     115                        else :     
     116                            cost = userpquota.computeJobPrice(totalsize) 
     117                            msg = _("Cost on printer %s : %.2f") % (printer.Name, cost) 
     118                            if printer.PassThrough : 
     119                                msg = "%s (%s)" % (msg, _("won't be charged, printer is in passthrough mode")) 
     120                            elif user.LimitBy == "nochange" :     
     121                                msg = "%s (%s)" % (msg, _("won't be charged, your account is immutable")) 
     122                            print msg     
    112123             
    113124if __name__ == "__main__" :