Changeset 2062 for pykota/trunk/pykota
- Timestamp:
- 02/15/05 00:39:50 (19 years ago)
- Location:
- pykota/trunk/pykota
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/config.py
r2054 r2062 22 22 # 23 23 # $Log$ 24 # Revision 1.60 2005/02/14 23:39:50 jalet 25 # Introduces the new 'trustjobsize' directive to workaround some printers 26 # generating unstable internal page counter values when queried through SNMP. 27 # 24 28 # Revision 1.59 2005/02/13 22:02:29 jalet 25 29 # Big database structure changes. Upgrade script is now included as well as … … 630 634 except PyKotaConfigError : 631 635 return None 636 637 def getTrustJobSize(self, printername) : 638 """Returns the normalized value of the trustjobsize's directive.""" 639 try : 640 value = self.getPrinterOption(printername, "trustjobsize").strip().upper() 641 except PyKotaConfigError : 642 return (None, "YES") 643 else : 644 if value == "YES" : 645 return (None, "YES") 646 try : 647 (limit, replacement) = [p.strip() for p in value.split(">")[1].split(":")] 648 limit = int(limit) 649 try : 650 replacement = int(replacement) 651 except ValueError : 652 if replacement != "PRECOMPUTED" : 653 raise 654 if limit < 0 : 655 raise ValueError 656 if (replacement != "PRECOMPUTED") and (replacement < 0) : 657 raise ValueError 658 except (IndexError, ValueError, TypeError) : 659 raise PyKotaConfigError, _("Option trustjobsize for printer %s is incorrect") % printername 660 return (limit, replacement) -
pykota/trunk/pykota/version.py
r2054 r2062 22 22 # 23 23 24 __version__ = "1.21alpha2 4_unofficial"24 __version__ = "1.21alpha25_unofficial" 25 25 26 26 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""