Changeset 1759 for pykota/trunk
- Timestamp:
- 09/30/04 13:22:30 (20 years ago)
- Location:
- pykota/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/autopykota
r1758 r1759 24 24 # 25 25 # $Log$ 26 # Revision 1.2 2004/09/30 11:22:30 jalet 27 # Extends the PATH and doesn't use absolute path anymore to launch edpykota. 28 # 26 29 # Revision 1.1 2004/09/30 09:52:45 jalet 27 30 # Initial release of autopykota. Reading help or manpage is greatly … … 80 83 def main(self, arguments, options) : 81 84 """Main entry point.""" 85 os.environ["PATH"] = "%s:/bin:/usr/bin:/usr/local/bin:/opt/bin" % os.environ.get("PATH", "") 82 86 username = os.environ.get("PYKOTAUSERNAME") 83 87 printername = os.environ.get("PYKOTAPRINTERNAME") … … 95 99 else : 96 100 self.logdebug("User %s already exists. Creating a quota entry for user %s on printer %s." % (username, username, printername)) 97 return os.system(' /usr/bin/edpykota --add --printer "%s" "%s"' % (printername, username))101 return os.system('edpykota --add --printer "%s" "%s"' % (printername, username)) 98 102 else : 99 103 self.logdebug("User %s already exists. Printer %s doesn't exist. Creating printer %s and a quota entry for user %s on printer %s." % (username, printername, printername, username, printername)) 100 return os.system(' /usr/bin/edpykota --add --printer "%s" "%s"' % (printername, username))104 return os.system('edpykota --add --printer "%s" "%s"' % (printername, username)) 101 105 else : 102 106 if options["initbalance"] is None : … … 104 108 else : 105 109 self.logdebug("User %s doesn't exist yet. Creating user %s's account and quota entries on all existing printers." % (username, username)) 106 return os.system(' /usr/bin/edpykota --add --limitby balance --balance "%s" "%s"' % (options["initbalance"], username))110 return os.system('edpykota --add --limitby balance --balance "%s" "%s"' % (options["initbalance"], username)) 107 111 108 112 if __name__ == "__main__" : -
pykota/trunk/conf/pykota.conf.sample
r1757 r1759 481 481 # 482 482 # policy: external(/usr/bin/edpykota --add --printer %(printername)s --softlimit 50 --hardlimit 60 %(username)s >/dev/null) 483 # 484 # NB : If you want to limit users by their account balance value, it is preferable to 485 # use the following policy to automate user account creation on first print : 486 # 487 # policy: external(/usr/bin/autopykota --initbalance 25.0 >/dev/null) 488 # 489 # This will automatically add the user if he doesn't already exist, and 490 # set his initial balance value to 25.0 (for example). If the user already 491 # exists then his balance value will not be modified. 492 # Please don't use autopykota if you want to limit your users by page 493 # quota, and in any case, carefully read autopykota's help or manpage 494 # and understand its goal before using it in your own configuration. 483 495 # 484 496 # Of course you can launch any command of your choice with this, e.g. :