Changeset 1200 for pykota/trunk/pykota

Show
Ignore:
Timestamp:
11/21/03 15:28:46 (21 years ago)
Author:
jalet
Message:

More complete job history.

Location:
pykota/trunk/pykota
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/accounters/external.py

    r1180 r1200  
    2222# 
    2323# $Log$ 
     24# Revision 1.9  2003/11/21 14:28:45  jalet 
     25# More complete job history. 
     26# 
    2427# Revision 1.8  2003/11/12 23:29:24  jalet 
    2528# More work on new backend. This commit may be unstable. 
     
    104107         
    105108        # adds the current job to history     
    106         printer.addJobToHistory(self.filter.jobid, user, self.getLastPageCounter(), action, jobsize) 
     109        printer.addJobToHistory(self.filter.jobid, user, self.getLastPageCounter(), action, jobsize, self.filter.preserveinputfile, self.filter.title, self.filter.copies, self.filter.options) 
    107110         
    108111        self.endJob(printer, user) 
  • pykota/trunk/pykota/accounters/querying.py

    r1180 r1200  
    2222# 
    2323# $Log$ 
     24# Revision 1.8  2003/11/21 14:28:46  jalet 
     25# More complete job history. 
     26# 
    2427# Revision 1.7  2003/11/12 23:29:24  jalet 
    2528# More work on new backend. This commit may be unstable. 
     
    178181         
    179182        # adds the current job to history     
    180         printer.addJobToHistory(self.filter.jobid, user, counterbeforejob, action) 
     183        printer.addJobToHistory(self.filter.jobid, user, counterbeforejob, action, filename=self.filter.preserveinputfile, title=self.filter.title, copies=self.filter.copies, options=self.filter.options) 
    181184             
    182185        return action 
  • pykota/trunk/pykota/accounters/stupid.py

    r1180 r1200  
    2222# 
    2323# $Log$ 
     24# Revision 1.7  2003/11/21 14:28:46  jalet 
     25# More complete job history. 
     26# 
    2427# Revision 1.6  2003/11/12 23:29:24  jalet 
    2528# More work on new backend. This commit may be unstable. 
     
    106109         
    107110        # adds the current job to history     
    108         printer.addJobToHistory(self.filter.jobid, user, counterbeforejob, action, jobsize) 
     111        printer.addJobToHistory(self.filter.jobid, user, counterbeforejob, action, jobsize, self.filter.preserveinputfile, self.filter.title, self.filter.copies, self.filter.options) 
    109112             
    110113        return action 
  • pykota/trunk/pykota/storage.py

    r1151 r1200  
    2222# 
    2323# $Log$ 
     24# Revision 1.26  2003/11/21 14:28:45  jalet 
     25# More complete job history. 
     26# 
    2427# Revision 1.25  2003/10/08 21:12:27  jalet 
    2528# Do not cache anymore entries which don't exist. 
     
    211214        self.LastJob = None 
    212215         
    213     def addJobToHistory(self, jobid, user, pagecounter, action, jobsize=None) :     
     216    def addJobToHistory(self, jobid, user, pagecounter, action, jobsize=None, filename=None, title=None, copies=None, options=None) :     
    214217        """Adds a job to the printer's history.""" 
    215         self.parent.writeJobNew(self, user, jobid, pagecounter, action, jobsize) 
     218        self.parent.writeJobNew(self, user, jobid, pagecounter, action, jobsize, filename, title, copies, options) 
    216219        # TODO : update LastJob object ? Probably not needed. 
    217220         
  • pykota/trunk/pykota/storages/ldapstorage.py

    r1179 r1200  
    2222# 
    2323# $Log$ 
     24# Revision 1.36  2003/11/21 14:28:46  jalet 
     25# More complete job history. 
     26# 
    2427# Revision 1.35  2003/11/12 13:06:37  jalet 
    2528# Bug fix wrt no user/group name command line argument to edpykota 
     
    690693        self.doModify(lastjob.ident, fields)          
    691694         
    692     def writeJobNew(self, printer, user, jobid, pagecounter, action, jobsize=None) :     
     695    def writeJobNew(self, printer, user, jobid, pagecounter, action, jobsize=None, filename=None, title=None, copies=None, options=None) :     
    693696        """Adds a job in a printer's history.""" 
    694697        if (not self.disablehistory) or (not printer.LastJob.Exists) : 
     
    706709                   "pykotaPrinterPageCounter" : str(pagecounter), 
    707710                   "pykotaAction" : action, 
     711                   "pykotaFileName" : str(filename),  
     712                   "pykotaTitle" : str(title),  
     713                   "pykotaCopies" : str(copies),  
     714                   "pykotaOptions" : str(options),  
    708715                 } 
    709716        if (not self.disablehistory) or (not printer.LastJob.Exists) : 
  • pykota/trunk/pykota/storages/pgstorage.py

    r1179 r1200  
    2222# 
    2323# $Log$ 
     24# Revision 1.22  2003/11/21 14:28:46  jalet 
     25# More complete job history. 
     26# 
    2427# Revision 1.21  2003/11/12 13:06:38  jalet 
    2528# Bug fix wrt no user/group name command line argument to edpykota 
     
    447450        self.doModify("UPDATE jobhistory SET jobsize=%s WHERE id=%s" % (self.doQuote(jobsize), self.doQuote(lastjob.ident))) 
    448451         
    449     def writeJobNew(self, printer, user, jobid, pagecounter, action, jobsize=None) :     
     452    def writeJobNew(self, printer, user, jobid, pagecounter, action, jobsize=None, filename=None, title=None, copies=None, options=None) :     
    450453        """Adds a job in a printer's history.""" 
    451454        if (not self.disablehistory) or (not printer.LastJob.Exists) : 
    452455            if jobsize is not None : 
    453                 self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action, jobsize) VALUES (%s, %s, %s, %s, %s, %s)" % (self.doQuote(user.ident), self.doQuote(printer.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(jobsize))) 
     456                self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action, jobsize, filename, title, copies, options) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)" % (self.doQuote(user.ident), self.doQuote(printer.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(jobsize), self.doQuote(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options))) 
    454457            else :     
    455                 self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action) VALUES (%s, %s, %s, %s, %s)" % (self.doQuote(user.ident), self.doQuote(printer.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action))) 
     458                self.doModify("INSERT INTO jobhistory (userid, printerid, jobid, pagecounter, action, filename, title, copies, options) VALUES (%s, %s, %s, %s, %s)" % (self.doQuote(user.ident), self.doQuote(printer.ident), self.doQuote(jobid), self.doQuote(pagecounter), self.doQuote(action), self.doQuote(filename), self.doQuote(title), self.doQuote(copies), self.doQuote(options))) 
    456459        else :         
    457460            # here we explicitly want to reset jobsize to NULL if needed 
  • pykota/trunk/pykota/tool.py

    r1196 r1200  
    2222# 
    2323# $Log$ 
     24# Revision 1.58  2003/11/21 14:28:45  jalet 
     25# More complete job history. 
     26# 
    2427# Revision 1.57  2003/11/19 23:19:38  jalet 
    2528# Code refactoring work. 
     
    624627         self.options, \ 
    625628         self.originalbackend) = self.extractInfoFromCupsOrLprng() 
     629        self.preserveinputfile = self.inputfile  
    626630        self.accounter = openAccounter(self) 
    627631     
     
    669673        else :     
    670674            # Try to detect LPRng 
     675            # TODO : try to extract filename, job's title, and options if available 
    671676            jseen = Pseen = nseen = rseen = Kseen = None 
    672677            for arg in sys.argv : 
  • pykota/trunk/pykota/version.py

    r1194 r1200  
    2222# 
    2323 
    24 __version__ = "1.16alpha10_unofficial" 
     24__version__ = "1.16alpha11_unofficial" 
    2525 
    2626__doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""