Changeset 759

Show
Ignore:
Timestamp:
02/08/03 10:59:59 (22 years ago)
Author:
jalet
Message:

Added preliminary base class for all storages

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/storage.py

    r698 r759  
    1515# 
    1616# $Log$ 
     17# Revision 1.4  2003/02/08 09:59:59  jalet 
     18# Added preliminary base class for all storages 
     19# 
    1720# Revision 1.3  2003/02/05 22:10:29  jalet 
    1821# Typos 
     
    3639    __str__ = __repr__ 
    3740     
     41class BaseStorage :     
     42    """Base class for all storages.""" 
     43    def getMatchingPrinters(self, printerpattern) : 
     44        """Returns the list of all printer names which match a certain pattern.""" 
     45        pass 
     46             
     47    def addPrinter(self, printername) :         
     48        """Adds a printer to the quota storage.""" 
     49        pass 
     50         
     51    def getPrinterUsers(self, printername) :         
     52        """Returns the list of usernames which uses a given printer.""" 
     53        pass 
     54         
     55    def getPrinterGroups(self, printername) :         
     56        """Returns the list of groups which uses a given printer.""" 
     57        pass 
     58         
     59    def getPrinterPageCounter(self, printername) : 
     60        """Returns the last page counter value for a printer given its name.""" 
     61        pass 
     62         
     63    def updatePrinterPageCounter(self, printername, username, pagecount) : 
     64        """Updates the last page counter information for a printer given its name, last username and pagecount.""" 
     65        pass 
     66         
     67    def addUserPQuota(self, username, printername) : 
     68        """Adds a tuple (user, printer) to the Quota Storage, both are also added individually if needed.""" 
     69        pass 
     70         
     71    def getUPIds(self, username, printername) :     
     72        """Returns a tuple (userid, printerid) given a username and a printername.""" 
     73        pass 
     74         
     75    def getUserPQuota(self, username, printername) : 
     76        """Returns the Print Quota information for a given (username, printername).""" 
     77        pass 
     78         
     79    def setUserPQuota(self, username, printername, softlimit, hardlimit) : 
     80        """Sets soft and hard limits for a user quota on a specific printer given (username, printername).""" 
     81        pass 
     82         
     83    def setDateLimit(self, username, printername, datelimit) : 
     84        """Sets the limit date for a soft limit to become an hard one given (username, printername).""" 
     85        pass 
     86         
     87    def updateUserPQuota(self, username, printername, pagecount) : 
     88        """Updates the used user Quota information given (username, printername) and a job size in pages.""" 
     89        pass 
     90         
     91    def buyUserPQuota(self, username, printername, pagebought) : 
     92        """Buys pages for a given (username, printername).""" 
     93        pass 
     94         
    3895def openConnection(config, asadmin=0) : 
    3996    """Returns a connection handle to the appropriate Quota Storage Database.""" 
     
    48105    else :     
    49106        return getattr(storagebackend, "Storage")(host, database, (asadmin and admin) or user) 
     107