Changeset 2266 for pykota/trunk/pykota/storages/ldapstorage.py
- Timestamp:
- 05/21/05 00:40:21 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/storages/ldapstorage.py
r2222 r2266 1044 1044 self.doModify(pgroup.ident, fields) 1045 1045 1046 def retrieveHistory(self, user=None, printer=None, datelimit=None, hostname=None, billingcode=None, limit=100) :1047 """Retrieves all print jobs for user on printer (or all) be foredate, limited to first 100 results."""1046 def retrieveHistory(self, user=None, printer=None, hostname=None, billingcode=None, limit=100, start=None, end=None) : 1047 """Retrieves all print jobs for user on printer (or all) between start and end date, limited to first 100 results.""" 1048 1048 precond = "(objectClass=pykotaJob)" 1049 1049 where = [] … … 1110 1110 minute = int(date[10:12]) 1111 1111 second = int(date[12:14]) 1112 job.JobDate = "%04i-%02i-%02i %02i:%02i:%02i" % (year, month, day, hour, minute, second) 1113 if (datelimit is None) or (job.JobDate <= datelimit) : 1112 job.JobDate = "%04i%02i%02i %02i:%02i:%02i" % (year, month, day, hour, minute, second) 1113 if ((start is None) and (end is None)) or \ 1114 ((start is None) and (job.JobDate <= end)) or \ 1115 ((end is None) and (job.JobDate >= start)) or \ 1116 ((job.JobDate >= start) and (job.JobDate <= end)) : 1114 1117 job.UserName = fields.get("pykotaUserName")[0] 1115 1118 job.PrinterName = fields.get("pykotaPrinterName")[0] … … 1335 1338 else : 1336 1339 printer = None 1337 entries = self.retrieveHistory(user, printer, hostname=extractonly.get("hostname"), billingcode=extractonly.get("billingcode"), limit=None) 1340 startdate = extractonly.get("start") 1341 enddate = extractonly.get("end") 1342 for limit in ("start", "end") : 1343 try : 1344 del extractonly[limit] 1345 except KeyError : 1346 pass 1347 (startdate, enddate) = self.cleanDates(startdate, enddate) 1348 entries = self.retrieveHistory(user, printer, hostname=extractonly.get("hostname"), billingcode=extractonly.get("billingcode"), limit=None, start=startdate, end=enddate) 1338 1349 if entries : 1339 1350 result = [ ("username", "printername", "dn", "jobid", "pagecounter", "jobsize", "action", "jobdate", "filename", "title", "copies", "options", "jobprice", "hostname", "jobsizebytes", "md5sum", "pages", "billingcode") ]