Show
Ignore:
Timestamp:
02/12/06 13:32:53 (18 years ago)
Author:
jerome
Message:

Modified pkprinters to improve speed just like I did for pkbcodes earlier.
edpykota had to be modified as well to use the new printer API.
The time spent to modify printers has been almost halved.

Files:
1 modified

Legend:

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

    r2680 r2686  
    10171017        return self.getGroupPQuota(group, printer) 
    10181018         
    1019     def writePrinterPrices(self, printer) :     
    1020         """Write the printer's prices back into the storage.""" 
     1019    def savePrinter(self, printer) :     
     1020        """Saves the printer to the database in a single operation.""" 
    10211021        fields = { 
     1022                   "pykotaPassThrough" : (printer.PassThrough and "t") or "f", 
     1023                   "pykotaMaxJobSize" : (printer.MaxJobSize and str(printer.MaxJobSize)) or "0", 
     1024                   "description" : self.userCharsetToDatabase(printer.Description or ""), 
    10221025                   "pykotaPricePerPage" : str(printer.PricePerPage), 
    10231026                   "pykotaPricePerJob" : str(printer.PricePerJob), 
    1024                  } 
    1025         self.doModify(printer.ident, fields) 
    1026          
    1027     def writePrinterDescription(self, printer) :     
    1028         """Write the printer's description back into the storage.""" 
    1029         fields = { 
    1030                    "description" : self.userCharsetToDatabase(printer.Description or ""), 
    1031                  } 
    1032         if fields["description"] : 
    1033             self.doModify(printer.ident, fields) 
    1034              
    1035     def setPrinterMaxJobSize(self, printer, maxjobsize) :      
    1036         """Write the printer's maxjobsize attribute.""" 
    1037         fields = { 
    1038                    "pykotaMaxJobSize" : (maxjobsize and str(maxjobsize)) or "0", 
    1039                  } 
    1040         self.doModify(printer.ident, fields) 
    1041          
    1042     def setPrinterPassThroughMode(self, printer, passthrough) : 
    1043         """Write the printer's passthrough attribute.""" 
    1044         fields = { 
    1045                    "pykotaPassThrough" : (passthrough and "t") or "f", 
    10461027                 } 
    10471028        self.doModify(printer.ident, fields)