Changeset 2464

Show
Ignore:
Timestamp:
09/19/05 18:57:12 (19 years ago)
Author:
jerome
Message:

Added support to write the maxjobsize and passthrough attributes
for printers.

Location:
pykota/trunk/pykota/storages
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storages/ldapstorage.py

    r2461 r2464  
    902902        if fields["description"] : 
    903903            self.doModify(printer.ident, fields) 
     904             
     905    def setPrinterMaxJobSize(self, printer, maxjobsize) :      
     906        """Write the printer's maxjobsize attribute.""" 
     907        fields = { 
     908                   "pykotaMaxJobSize" : (maxjobsize and str(maxjobsize)) or "0", 
     909                 } 
     910        self.doModify(printer.ident, fields) 
     911         
     912    def setPrinterPassThroughMode(self, printer, passthrough) : 
     913        """Write the printer's passthrough attribute.""" 
     914        fields = { 
     915                   "pykotaPassThrough" : (passthrough and "t") or "f", 
     916                 } 
     917        self.doModify(printer.ident, fields) 
    904918         
    905919    def writeUserOverCharge(self, user, factor) : 
  • pykota/trunk/pykota/storages/sql.py

    r2459 r2464  
    477477        self.doModify("UPDATE printers SET description=%s WHERE id=%s" % (self.doQuote(description), self.doQuote(printer.ident))) 
    478478         
     479    def setPrinterMaxJobSize(self, printer, maxjobsize) :      
     480        """Write the printer's maxjobsize attribute.""" 
     481        self.doModify("UPDATE printers SET maxjobsize=%s WHERE id=%s" % (self.doQuote(maxjobsize), self.doQuote(printer.ident))) 
     482         
     483    def setPrinterPassThroughMode(self, printer, passthrough) : 
     484        """Write the printer's passthrough attribute.""" 
     485        self.doModify("UPDATE printers SET passthrough=%s WHERE id=%s" % (self.doQuote((passthrough and "t") or "f"), self.doQuote(printer.ident))) 
     486         
    479487    def writeUserOverCharge(self, user, factor) : 
    480488        """Sets the user's overcharging coefficient."""