Changeset 3162 for pykota/trunk
- Timestamp:
- 04/14/07 10:50:47 (18 years ago)
- Location:
- pykota/trunk
- Files:
-
- 7 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/conf/pykota.conf.sample
r3158 r3162 671 671 accounter: software() 672 672 673 673 # Should we ensure that the printer really is idle before 674 # sending the job's datas to it ? 675 # 676 # This directive is only used when you use an internal 677 #�hardware accounting mechanism, like hardware(snmp) or 678 # hardware(pjl), and is not used for external hardware 679 # accounting mechanisms or for software or ink accounting. 680 # 681 # If PyKota and CUPS are properly configured, i.e. a single 682 # computer (the print server) can access to a particular physical 683 # printer, or all CUPS+PyKota print servers which access to the 684 # same physical printer share a common network directory used 685 # by PyKota to lock this printer resource, then it is not necessary 686 # to really ensure the printer is idle before the job, because 687 # this is already the case : we already wait at the end of the 688 # preceding job for the printer to be idle before reading its 689 # internal page counter. So setting this value to Yes usually 690 # saves a lot of time between jobs, generally around 30 seconds. 691 # 692 # If you're not sure, leave this value to the default which is No, 693 # meaning that before sending the job's datas to the printer, PyKota 694 # will ensure this printer is in idle state. 695 # 696 # If not defined, a value of No is assumed. 697 # 698 # This value can be set either globally or on a per printer basis 699 # If both are defined, the printer option has priority. 700 # 701 # Sane default : 702 # 703 skipinitialwait : no 674 704 675 705 # What is the "pre"-accounter used for precomputing the job's size. -
pykota/trunk/pykota/accounters/hardware.py
r3133 r3162 109 109 The external command must report the life time page number of the printer on stdout. 110 110 """ 111 skipinitialwait = self.filter.config.getPrinterSkipInitialWait(printer) 111 112 commandline = self.arguments.strip() % locals() 112 113 cmdlower = commandline.lower() 113 114 if (cmdlower == "snmp") or cmdlower.startswith("snmp:") : 114 return snmp.Handler(self, printer ).retrieveInternalPageCounter()115 return snmp.Handler(self, printer, skipinitialwait).retrieveInternalPageCounter() 115 116 elif (cmdlower == "pjl") or cmdlower.startswith("pjl:") : 116 return pjl.Handler(self, printer ).retrieveInternalPageCounter()117 return pjl.Handler(self, printer, skipinitialwait).retrieveInternalPageCounter() 117 118 118 119 if printer is None : -
pykota/trunk/pykota/accounters/pjl.py
r3133 r3162 58 58 class Handler : 59 59 """A class for PJL print accounting.""" 60 def __init__(self, parent, printerhostname ) :60 def __init__(self, parent, printerhostname, skipinitialwait=False) : 61 61 self.parent = parent 62 62 self.printerHostname = printerhostname 63 self.skipinitialwait = skipinitialwait 63 64 try : 64 65 self.port = int(self.parent.arguments.split(":")[1].strip()) … … 181 182 while 1 : 182 183 self.retrievePJLValues() 184 if (self.printerInternalPageCounter is not None) \ 185 and self.skipinitialwait \ 186 and (os.environ.get("PYKOTAPHASE") == "BEFORE") : 187 self.parent.filter.logdebug("No need to wait for the printer to be idle, this should be the case already.") 188 return 183 189 idle_flag = 0 184 190 if self.printerStatus in ('10000', '10001', '35078', '40000') : -
pykota/trunk/pykota/accounters/snmp.py
r3161 r3162 109 109 class BaseHandler : 110 110 """A class for SNMP print accounting.""" 111 def __init__(self, parent, printerhostname ) :111 def __init__(self, parent, printerhostname, skipinitialwait=False) : 112 112 self.parent = parent 113 113 self.printerHostname = printerhostname 114 self.skipinitialwait = skipinitialwait 114 115 try : 115 116 self.community = self.parent.arguments.split(":")[1].strip() … … 210 211 while 1 : 211 212 self.retrieveSNMPValues() 213 if (self.printerInternalPageCounter is not None) \ 214 and self.skipinitialwait \ 215 and (os.environ.get("PYKOTAPHASE") == "BEFORE") : 216 self.parent.filter.logdebug("No need to wait for the printer to be idle, this should be the case already.") 217 return 212 218 pstatusAsString = printerStatusValues.get(self.printerStatus) 213 219 dstatusAsString = deviceStatusValues.get(self.deviceStatus) -
pykota/trunk/pykota/config.py
r3158 r3162 691 691 else : 692 692 del branches[k] # empty value disables a global option 693 694 693 return branches 694 695 def getPrinterSkipInitialWait(self, printername) : 696 """Returns True if we want to skip the initial waiting loop, else False.""" 697 try : 698 return self.isTrue(self.getPrinterOption(printername, "skipinitialwait")) 699 except PyKotaConfigError : 700 return False -
pykota/trunk/pykota/version.py
r3153 r3162 22 22 # 23 23 24 __version__ = "1.26alpha 4_unofficial"24 __version__ = "1.26alpha5_unofficial" 25 25 26 26 __doc__ = "PyKota : a complete Printing Quota Solution for CUPS." -
pykota/trunk/TODO
r3157 r3162 28 28 minimal price. The value wouldn't be used (yet?) for 29 29 normal page accounting. 30 31 - Allow for configurable setting wrt the fact that PyKota waits32 for the printer being idle before asking for printer's internal33 page counter before sending any data to the printer : if34 the print server is correctly configured (i.e. only PyKota can35 access to this particular printer), then we know for sure the36 printer will be idle at this time, because we wait for it37 to become idle again after having printed the job => we could38 save up to 50% of waiting time, and handle more jobs39 in the same time.40 30 41 31 - --orderby and --order ASC|DESC for dumpykota (or --asc | --desc)