- Timestamp:
- 12/02/04 22:24:51 (20 years ago)
- Location:
- pykota/trunk
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/edpykota
r1956 r1967 24 24 # 25 25 # $Log$ 26 # Revision 1.83 2004/12/02 21:24:50 jalet 27 # Integrated the patch by Wilson Roberto Afonso and Matt Hyclak to allow 28 # edpykota to accept the -U | --used value command line option. 29 # 26 30 # Revision 1.82 2004/11/22 21:53:38 jalet 27 31 # Added the reject_unknown directive to pykota.conf to reject user/group … … 362 366 -R | --hardreset Resets the actual and life time page counters 363 367 for the user or group to zero on the specified 364 printers. 368 printers. This is a shortcut for '--used 0'. 365 369 366 370 -l | --limitby l Choose if the user/group is limited in printing … … 384 388 385 389 -H | --hardlimit hl Sets the quota hard limit to hl pages. 386 390 391 -U | --used usage Sets the pagecounters for the user to usage pages; 392 useful for migrating users from a different system 393 where they have already used some pages. Actual 394 and Life Time page counters may be increased or decreased 395 if usage is prefixed with + or -. 396 WARNING : BOTH page counters are modified in all cases, 397 so be careful. 398 NB : if 'usage' equals '0', then the action taken is 399 the same as if --hardreset was used. 400 387 401 user1 through userN and group1 through groupN can use wildcards 388 402 if the --add option is not set. … … 482 496 suffix = (options["groups"] and "Group") or "User" 483 497 484 softlimit = hardlimit = None 498 softlimit = hardlimit = None 499 500 used = options["used"] 501 if used : 502 used = used.strip() 503 try : 504 int(used) 505 except ValueError : 506 raise PyKotaToolError, _("Invalid used value %s.") % used 507 485 508 if not options["noquota"] : 486 509 if options["softlimit"] : … … 668 691 if options["reset"] : 669 692 entrypquota.reset() 670 elif options["hardreset"] :693 if options["hardreset"] : 671 694 entrypquota.hardreset() 695 if options["used"] : 696 entrypquota.setUsage(used) 672 697 673 698 if balance : … … 692 717 else : 693 718 self.printInfo(_("Group %s not found in the PyKota Storage.") % groupname) 694 695 # This line disabled to prevent sending of unwanted email696 # messages if quota is reached at creation/modification time.697 # The check will be done at print time anyway.698 # getattr(self, "warn%sPQuota" % suffix)(entrypquota)699 719 700 720 # Now delete what has to be deleted … … 708 728 "printer" : "*", \ 709 729 } 710 short_options = "vhdc:l:b:i:naugrp:P:S:H:G:R "711 long_options = ["help", "version", "charge=", "delete", "limitby=", "balance=", "ingroups=", "noquota", "add", "users", "groups", "reset", "hardreset", "prototype=", "printer=", "softlimit=", "hardlimit=", "pgroups=" ]730 short_options = "vhdc:l:b:i:naugrp:P:S:H:G:RU:" 731 long_options = ["help", "version", "charge=", "delete", "limitby=", "balance=", "ingroups=", "noquota", "add", "users", "groups", "reset", "hardreset", "prototype=", "printer=", "softlimit=", "hardlimit=", "pgroups=", "used="] 712 732 713 733 # Initializes the command line tool … … 736 756 options["pgroups"] = options["G"] or options["pgroups"] 737 757 options["hardreset"] = options["R"] or options["hardreset"] 758 options["used"] = options["U"] or options["used"] 738 759 739 760 if options["help"] : … … 749 770 elif options["noquota"] and (options["prototype"] or options["hardlimit"] or options["softlimit"]) : 750 771 raise PyKotaToolError, _("incompatible options, see help.") 751 elif options["groups"] and (options["balance"] or options["ingroups"] ) :772 elif options["groups"] and (options["balance"] or options["ingroups"] or options["used"] or options["reset"] or options["hardreset"]) : 752 773 raise PyKotaToolError, _("incompatible options, see help.") 753 774 else : -
pykota/trunk/NEWS
r1966 r1967 22 22 PyKota NEWS : 23 23 24 - 1.21alpha11 : 25 26 - edpkota now accepts the -U | --used value command line argument 27 to preset the page counters to an initial value. Thanks to 28 Wilson Roberto Afonso and Matt Hyclak for the patch. 29 24 30 - 1.21alpha10 : 25 31 -
pykota/trunk/pykota/storage.py
r1875 r1967 22 22 # 23 23 # $Log$ 24 # Revision 1.66 2004/12/02 21:24:50 jalet 25 # Integrated the patch by Wilson Roberto Afonso and Matt Hyclak to allow 26 # edpykota to accept the -U | --used value command line option. 27 # 24 28 # Revision 1.65 2004/10/25 14:12:25 jalet 25 29 # For URGENT legal reasons (Italy), a new "privacy" directive was added to pykota.conf … … 439 443 self.DateLimit = None 440 444 445 def setUsage(self, used) : 446 """Sets the PageCounter and LifePageCounter to used, or if used is + or - prefixed, changes the values of {Life,}PageCounter by that amount.""" 447 vused = int(used) 448 if used.startswith("+") or used.startswith("-") : 449 self.parent.increaseUserPQuotaPagesCounters(self, vused) 450 self.PageCounter += vused 451 self.LifePageCounter += vused 452 else : 453 self.parent.writeUserPQuotaPagesCounters(self, vused, vused) 454 self.PageCounter = self.LifePageCounter = vused 455 441 456 def reset(self) : 442 457 """Resets page counter to 0.""" -
pykota/trunk/pykota/version.py
r1966 r1967 22 22 # 23 23 24 __version__ = "1.21alpha1 0_unofficial"24 __version__ = "1.21alpha11_unofficial" 25 25 26 26 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""