IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33710


Ignore:
Timestamp:
Apr 4, 2012, 4:24:10 PM (14 years ago)
Author:
rhenders
Message:

added method to get current config for this client; altered method to get list of configs to include only 'active' configs; added method to set the config for a given client

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/ipptopspsdb.py

    r33684 r33710  
    746746
    747747    '''
     748    Sets the config field for this client
     749    '''
     750    def setConfigForThisClient(self, config, host, pid):
     751
     752        self.execute("UPDATE clients SET config = '" + config + "' \
     753                WHERE host = '" + host + "' \
     754                AND pid = " + str(pid))
     755    '''
    748756    Sets the config field for a set of loader clients
    749757    '''
     
    831839    Returns a list of available configs
    832840    '''
    833     def getConfigList(self):
     841    def getActiveConfigList(self):
    834842       
    835         sql = "SELECT DISTINCT name FROM config"
     843        sql = "SELECT DISTINCT name FROM config WHERE active = 1 ORDER BY name"
    836844
    837845        configs = []
     
    880888
    881889    '''
    882     Reads config from the database and populates Config object
    883     '''
    884     def readConfig(self, host, pid):
    885 
    886         # first get config defined for this client
     890    Returns config for this client
     891    '''
     892    def getConfigForThisClient(self, host, pid):
     893
    887894        sql = "SELECT config \
    888895               FROM clients \
     
    898905            self.config.isLoaded = False
    899906            return False
     907
     908        return True
     909
     910    '''
     911    Reads config from the database and populates Config object
     912    '''
     913    def readConfig(self, host, pid):
     914
     915        # first get config defined for this client
     916        if not self.getConfigForThisClient(host, pid): return False
    900917
    901918        # now load that config
Note: See TracChangeset for help on using the changeset viewer.