Exemplo n.º 1
0
 def __init__(self):
                                
     accountingInterface = config.get_config('accountingInterface', type = str)
     if accountingInterface:
         self.__accountingInterface = accountingInterface           
     
     self.__accounting = create_tool(self.__accountingInterface)
Exemplo n.º 2
0
 def __init__(self):
     
     popularityInterface = config.get_config('popularityInterface', type = str)
     if popularityInterface:
         self.__popularityInterface = popularityInterface           
     
     self.__popularity = create_tool(self.__popularityInterface)
            
     creationlimit = config.get_config('creationlimit', int)        
     if creationlimit is not None:
         self.__creationlimit = creationlimit     
     
     thresholds = config.get_config('thresholds', list)
     lastaccess= config.get_config('lastaccess', 'list_2')
     
     is_parsed=self.__parseThresholds__(thresholds, lastaccess)
     if is_parsed:
         self.__logger.info('Successfully parsed the thresholds: %s'%str(self.__thresholds))
     else:
         self.__logger.error('Failed to parse thresholds from configuration file. Using default ones: %s'%str(self.__thresholds))
     
     # parse algorithm2 parameters
     algorithm2_spacetokens   = config.get_config('algorithm2_spacetokens'   ,list)
     if algorithm2_spacetokens is None:
         algorithm2_spacetokens = []
     algorithm2_creationlimit = config.get_dict  ('algorithm2_creationlimit' ,type='positive_int')        
     self.__algorithm2_spacetokens , self.__algorithm2_creationlimit = self.__verifyAlgorithm2param(algorithm2_spacetokens,
                                                                                                    algorithm2_creationlimit)
     self.__logger.debug('Algorithm2_spacetokens   : %s'%self.__algorithm2_spacetokens)
     self.__logger.debug('Algorithm2_creationlimit : %s'%self.__algorithm2_creationlimit)
Exemplo n.º 3
0
 def __init__(self):
     
     popularityInterface = config.get_config('popularityInterface', type = str)
     if popularityInterface:
         self.__popularityInterface = popularityInterface           
     
     self.__popularity = create_tool(self.__popularityInterface)
            
     creationlimit = config.get_config('creationlimit', int)        
     if creationlimit is not None:
         self.__creationlimit = creationlimit     
     
     thresholds = config.get_config('thresholds', list)
     lastaccess= config.get_config('lastaccess', 'list_2')
     
     is_parsed=self.__parseThresholds__(thresholds, lastaccess)
     if is_parsed:
         self.__logger.info('Successfully parsed the thresholds: %s'%str(self.__thresholds))
     else:
         self.__logger.error('Failed to parse thresholds from configuration file. Using default ones: %s'%str(self.__thresholds))
     
     # parse algorithm2 parameters
     algorithm2_spacetokens   = config.get_config('algorithm2_spacetokens', list)
     if algorithm2_spacetokens is None:
         algorithm2_spacetokens = []
     algorithm2_creationlimit = config.get_dict  ('algorithm2_creationlimit', type='positive_int')        
     self.__algorithm2_spacetokens, self.__algorithm2_creationlimit = self.__verifyAlgorithm2param(algorithm2_spacetokens,
                                                                                                    algorithm2_creationlimit)
     self.__logger.debug('Algorithm2_spacetokens   : %s'%self.__algorithm2_spacetokens)
     self.__logger.debug('Algorithm2_creationlimit : %s'%self.__algorithm2_creationlimit)
Exemplo n.º 4
0
    def __init__(self):

        accountingInterface = config.get_config('accountingInterface',
                                                type=str)
        if accountingInterface:
            self.__accountingInterface = accountingInterface

        self.__accounting = create_tool(self.__accountingInterface)