Changeset 2447
- Timestamp:
- 09/16/05 09:50:27 (19 years ago)
- Location:
- pykota/trunk
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/autopykota
r2366 r2447 63 63 raise PyKotaToolError, "Either the username or the printername is undefined. Fatal Error." 64 64 else : 65 printer = self.storage.getPrinter(printername) 65 66 user = self.storage.getUser(username) 66 67 if user.Exists : 67 68 self.logdebug("User %s already exits." % username) 68 printer = self.storage.getPrinter(printername)69 69 if printer.Exists : 70 70 userpquota = self.storage.getUserPQuota(user, printer) 71 71 if userpquota.Exists : 72 # we should never get there, unless autopykota was launched manually 72 73 self.logdebug("User %s's quota entry on printer %s already exists. Nothing to do." % (username, printername)) 73 74 return 0 74 75 else : 75 self.logdebug("Creating a quota entry for user %s on printer %s." % (username, printername)) 76 return os.system('edpykota --add --printer "%s" "%s"' % (printername, username)) 76 printersnames = [printer.Name] + [p.Name for p in self.storage.getParentPrinters(printer)] 77 self.logdebug("Creating a quota entry for user %s on printers %s" % (username, printersnames)) 78 return os.system('edpykota --add --printer "%s" "%s"' % (','.join(printersnames), username)) 77 79 else : 78 80 self.logdebug("Printer %s doesn't exist. Creating printer %s and a quota entry for user %s on printer %s." % (printername, printername, username, printername)) 79 81 return os.system('edpykota --add --printer "%s" "%s"' % (printername, username)) 80 82 else : 83 if printer.Exists : 84 printersnames = [printer.Name] + [p.Name for p in self.storage.getParentPrinters(printer)] 85 else : 86 printersnames = [printer.Name] 81 87 self.logdebug("User %s doesn't exist yet." % username) 82 self.logdebug("Creating user %s's account with balance %s and quota entries on printer %s." % (username, options["initbalance"], printername))83 return os.system('edpykota --add --limitby balance --balance "%s" --printer "%s" "%s"' % (options["initbalance"], printername, username))88 self.logdebug("Creating user %s's account with balance %s and quota entries on printers %s" % (username, options["initbalance"], printersnames)) 89 return os.system('edpykota --add --limitby balance --balance "%s" --printer "%s" "%s"' % (options["initbalance"], ','.join(printersnames), username)) 84 90 85 91 if __name__ == "__main__" : -
pykota/trunk/NEWS
r2436 r2447 22 22 PyKota NEWS : 23 23 24 - 1.23alpha29 : 25 26 - Now autopykota also creates print quota entries for the user on the 27 printers groups the current printer is a member of. 28 24 29 - 1.23alpha28 : 25 30 -
pykota/trunk/pykota/version.py
r2435 r2447 22 22 # 23 23 24 __version__ = "1.23alpha2 8_unofficial"24 __version__ = "1.23alpha29_unofficial" 25 25 26 26 __doc__ = "PyKota : a complete Printing Quota Solution for CUPS and LPRng."