Changeset 2232 for pykota/trunk/bin/pykotme
- Timestamp:
- 05/05/05 23:52:49 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pykotme
r2216 r2232 104 104 self.printInfo(msg) 105 105 106 # get current user 107 username = pwd.getpwuid(os.geteuid())[0] 106 printers = self.storage.getMatchingPrinters(options["printer"]) 107 if not printers : 108 raise PyKotaToolError, _("There's no printer matching %s") % options["printer"] 109 110 username = pwd.getpwuid(os.getuid())[0] 108 111 user = self.storage.getUser(username) 109 112 if user.Exists and user.LimitBy and (user.LimitBy.lower() == "balance"): 110 113 print _("Your account balance : %.2f") % (user.AccountBalance or 0.0) 111 114 112 printers = self.storage.getMatchingPrinters(options["printer"])113 if not printers :114 raise PyKotaToolError, _("There's no printer matching %s") % options["printer"]115 116 115 print _("Job size : %i pages") % totalsize 117 for printer in printers : 118 userpquota = self.storage.getUserPQuota(user, printer) 119 cost = userpquota.computeJobPrice(totalsize) 120 print _("Cost on printer %s : %.2f") % (printer.Name, cost) 116 if user.Exists : 117 for printer in printers : 118 userpquota = self.storage.getUserPQuota(user, printer) 119 if userpquota.Exists : 120 cost = userpquota.computeJobPrice(totalsize) 121 print _("Cost on printer %s : %.2f") % (printer.Name, cost) 121 122 122 123 if __name__ == "__main__" :