Changeset 976 for pykota/trunk/pykota/accounter.py
- Timestamp:
- 04/30/03 15:36:40 (21 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/accounter.py
r973 r976 21 21 # 22 22 # $Log$ 23 # Revision 1.2 2003/04/30 13:36:40 jalet 24 # Stupid accounting method was added. 25 # 23 26 # Revision 1.1 2003/04/29 18:37:54 jalet 24 27 # Pluggable accounting methods (actually doesn't support external scripts) … … 26 29 # 27 30 # 31 32 import sys 28 33 29 34 class PyKotaAccounterError(Exception): … … 42 47 self.filter = kotafilter 43 48 49 def filterInput(self, inputfile) : 50 """Transparent filter.""" 51 mustclose = 0 52 if inputfile is not None : 53 if hasattr(inputfile, "read") : 54 infile = inputfile 55 else : 56 infile = open(inputfile, "rb") 57 mustclose = 1 58 else : 59 infile = sys.stdin 60 data = infile.read(256*1024) 61 while data : 62 sys.stdout.write(data) 63 data = infile.read(256*1024) 64 if mustclose : 65 infile.close() 66 44 67 def doAccounting(self, printerid, userid) : 45 68 """Does the real accounting."""