Changeset 2830
- Timestamp:
- 04/04/06 11:40:56 (19 years ago)
- Location:
- pykota/trunk/pykota
- Files:
-
- 11 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/accounters/pjl.py
r2637 r2830 202 202 """Tries PJL accounting for a printer host.""" 203 203 class fakeFilter : 204 """Fakes a filter for testing purposes.""" 204 205 def __init__(self) : 206 """Initializes the fake filter.""" 205 207 self.PrinterName = "FakePrintQueue" 206 208 self.JobSizeBytes = 1 207 209 208 210 def printInfo(self, msg, level="info") : 211 """Prints informational message.""" 209 212 sys.stderr.write("%s : %s\n" % (level.upper(), msg)) 210 213 sys.stderr.flush() 211 214 212 215 def logdebug(self, msg) : 216 """Prints debug message.""" 213 217 self.printInfo(msg, "debug") 214 218 215 219 class fakeAccounter : 220 """Fakes an accounter for testing purposes.""" 216 221 def __init__(self) : 222 """Initializes fake accounter.""" 217 223 self.arguments = "pjl:9100" 218 224 self.filter = fakeFilter() … … 220 226 221 227 def getLastPageCounter(self) : 228 """Fakes the return of a page counter.""" 222 229 return 0 223 230 -
pykota/trunk/pykota/accounters/snmp.py
r2637 r2830 211 211 """Tries SNMP accounting for a printer host.""" 212 212 class fakeFilter : 213 """Fakes a filter for testing purposes.""" 213 214 def __init__(self) : 215 """Initializes the fake filter.""" 214 216 self.PrinterName = "FakePrintQueue" 215 217 self.JobSizeBytes = 1 216 218 217 219 def printInfo(self, msg, level="info") : 220 """Prints informational message.""" 218 221 sys.stderr.write("%s : %s\n" % (level.upper(), msg)) 219 222 sys.stderr.flush() 220 223 221 224 def logdebug(self, msg) : 225 """Prints debug message.""" 222 226 self.printInfo(msg, "debug") 223 227 224 228 class fakeAccounter : 229 """Fakes an accounter for testing purposes.""" 225 230 def __init__(self) : 231 """Initializes fake accounter.""" 226 232 self.arguments = "snmp:public" 227 233 self.filter = fakeFilter() … … 229 235 230 236 def getLastPageCounter(self) : 237 """Fakes the return of a page counter.""" 231 238 return 0 232 239 -
pykota/trunk/pykota/dumper.py
r2664 r2830 249 249 sortindex = fields["jobdate"] 250 250 entries = entries[1:] 251 entries.sort(lambda m, n,si=sortindex : cmp(m[si], n[si]))251 entries.sort(lambda m, n, si=sortindex : cmp(m[si], n[si])) 252 252 for entry in entries : 253 253 printername = entry[fields["printername"]] -
pykota/trunk/pykota/reporters/html.py
r2622 r2830 25 25 import os 26 26 import urllib 27 from mx import DateTime28 27 29 from pykota.reporter import BaseReporter , PyKotaReporterError28 from pykota.reporter import BaseReporter 30 29 31 30 class Reporter(BaseReporter) : -
pykota/trunk/pykota/reporters/text.py
r2622 r2830 23 23 # 24 24 25 from pykota.reporter import BaseReporter , PyKotaReporterError25 from pykota.reporter import BaseReporter 26 26 27 27 class Reporter(BaseReporter) : -
pykota/trunk/pykota/storages/ldapstorage.py
r2798 r2830 30 30 31 31 import sys 32 import os33 32 import types 34 33 import time … … 39 38 from mx import DateTime 40 39 41 from pykota.storage import PyKotaStorageError, BaseStorage, StorageObject,\40 from pykota.storage import PyKotaStorageError, BaseStorage, \ 42 41 StorageUser, StorageGroup, StoragePrinter, \ 43 42 StorageJob, StorageLastJob, StorageUserPQuota, \ … … 827 826 names = [self.userCharsetToDatabase(n) for n in names] 828 827 if self.info["userquotabase"].lower() == "user" : 829 base = self.info["userbase"]828 base = self.info["userbase"] 830 829 else : 831 base = self.info["userquotabase"]830 base = self.info["userquotabase"] 832 831 result = self.doSearch("(&(objectClass=pykotaUserPQuota)(pykotaPrinterName=%s)(|%s))" % \ 833 832 (pname, "".join(["(pykotaUserName=%s)" % uname for uname in names])), \ … … 872 871 names = [self.userCharsetToDatabase(n) for n in names] 873 872 if self.info["groupquotabase"].lower() == "group" : 874 base = self.info["groupbase"]873 base = self.info["groupbase"] 875 874 else : 876 base = self.info["groupquotabase"]875 base = self.info["groupquotabase"] 877 876 result = self.doSearch("(&(objectClass=pykotaGroupPQuota)(pykotaPrinterName=%s)(|%s))" % \ 878 877 (pname, "".join(["(pykotaGroupName=%s)" % gname for gname in names])), \ -
pykota/trunk/pykota/storages/mysqlstorage.py
r2821 r2830 26 26 import time 27 27 28 from pykota.storage import PyKotaStorageError, BaseStorage,StorageObject,StorageUser,StorageGroup,StoragePrinter,StorageJob,StorageLastJob,StorageUserPQuota,StorageGroupPQuota28 from pykota.storage import PyKotaStorageError, BaseStorage 29 29 from pykota.storages.sql import SQLStorage 30 30 -
pykota/trunk/pykota/storages/pgstorage.py
r2773 r2830 26 26 from types import StringType 27 27 28 from pykota.storage import PyKotaStorageError, BaseStorage,StorageObject,StorageUser,StorageGroup,StoragePrinter,StorageJob,StorageLastJob,StorageUserPQuota,StorageGroupPQuota28 from pykota.storage import PyKotaStorageError, BaseStorage 29 29 from pykota.storages.sql import SQLStorage 30 30 -
pykota/trunk/pykota/storages/sqlitestorage.py
r2773 r2830 25 25 import time 26 26 27 from pykota.storage import PyKotaStorageError, BaseStorage,StorageObject,StorageUser,StorageGroup,StoragePrinter,StorageJob,StorageLastJob,StorageUserPQuota,StorageGroupPQuota27 from pykota.storage import PyKotaStorageError, BaseStorage 28 28 from pykota.storages.sql import SQLStorage 29 29 -
pykota/trunk/pykota/storages/sql.py
r2787 r2830 23 23 # 24 24 25 from pykota.storage import PyKotaStorageError, BaseStorage, StorageObject, \ 26 StorageUser, StorageGroup, StoragePrinter, \ 25 from pykota.storage import StorageUser, StorageGroup, StoragePrinter, \ 27 26 StorageJob, StorageLastJob, StorageUserPQuota, \ 28 27 StorageGroupPQuota, StorageBillingCode -
pykota/trunk/pykota/tool.py
r2807 r2830 31 31 import gettext 32 32 import locale 33 import signal34 33 import socket 35 import tempfile36 import md537 34 import time 38 import ConfigParser39 import popen240 35 from email.MIMEText import MIMEText 41 36 from email.Header import Header … … 43 38 from mx import DateTime 44 39 45 from pykota import config, storage, logger , accounter40 from pykota import config, storage, logger 46 41 from pykota.version import __version__, __author__, __years__, __gplblurb__ 47 42