Changeset 1529 for pykota/trunk
- Timestamp:
- 06/08/04 00:45:35 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/tool.py
r1523 r1529 22 22 # 23 23 # $Log$ 24 # Revision 1.97 2004/06/07 22:45:35 jalet 25 # Now accepts a job when enforcement is STRICT and predicted account balance 26 # is equal to 0.0 : since the job hasn't been printed yet, only its printing 27 # will really render balance equal to 0.0, so we should be allowed to print. 28 # 24 29 # Revision 1.96 2004/06/05 22:18:04 jalet 25 30 # Now catches some exceptions earlier. … … 634 639 else : 635 640 action = "ALLOW" 641 if (enforcement == "STRICT") and (val == 0.0) : 642 action = "WARN" # we can still print until account is 0 636 643 else : 637 644 val = grouppquota.PageCounter … … 708 715 else : 709 716 val = float(user.AccountBalance or 0.0) 710 if self.config.getPrinterEnforcement(printer.Name) == "STRICT" : 717 enforcement = self.config.getPrinterEnforcement(printer.Name) 718 if enforcement == "STRICT" : 711 719 val -= self.softwareJobPrice # use precomputed size. 712 720 if val <= 0.0 : 713 return"DENY"721 action = "DENY" 714 722 elif val <= self.config.getPoorMan() : 715 return "WARN" 716 else : 717 return "ALLOW" 723 action = "WARN" 724 else : 725 action = "ALLOW" 726 if (enforcement == "STRICT") and (val == 0.0) : 727 action = "WARN" # we can still print until account is 0 728 return action 718 729 else : 719 730 # Then check the user quota on current printer and all its parents.