def __init__(self, config=None):
        """ Set up queue manager.
        """
        self.config = config or {}
        self.proxy = None
        self.last_start = 0
        self.LOG = pymagic.get_class_logger(self)
        if 'log_level' in self.config:
            self.LOG.setLevel(config.log_level)
        self.LOG.debug("Queue manager created with config %r" % self.config)

        bool_param = lambda key, default: matching.truth(self.config.get(key, default), "job.%s.%s" % (self.config.job_name, key))

        self.config.quiet = bool_param("quiet", False)
        self.config.startable = matching.ConditionParser(engine.FieldDefinition.lookup, "name").parse(
            "[ %s ] [ %s ]" % (config_ini.torque['queue_startable_base'], self.config.startable)
        )
        self.LOG.info("Startable matcher for '%s' is: [ %s ]" % (self.config.job_name, self.config.startable))
        self.config.downloading = matching.ConditionParser(engine.FieldDefinition.lookup, "name").parse(
            "is_active=1 is_complete=0" + (" [ %s ]" % self.config.downloading if "downloading" in self.config else "")
        )
        self.LOG.info("Downloading matcher for '%s' is: [ %s ]" % (self.config.job_name, self.config.downloading))
        self.sort_key = formatting.validate_sort_fields(self.config.sort_fields) if self.config.sort_fields.strip() else None
def __init__ ( self , config = None ) : self . config = config or { } self . proxy = None self . last_start = 0 self . LOG = pymagic . get_class_logger ( self ) if 'log_level' in self . config : self . LOG . setLevel ( config . log_level ) self . LOG . debug ( "Queue manager created with config %r" % self . config ) bool_param = lambda key , default : matching . truth ( self . config . get ( key , default ) , "job.%s.%s" % ( self . config . job_name , key ) ) self . config . quiet = bool_param ( "quiet" , False ) self . config . startable = matching . ConditionParser ( engine . FieldDefinition . lookup , "name" ) . parse ( "[ %s ] [ %s ]" % ( config_ini . torque [ 'queue_startable_base' ] , self . config . startable ) ) self . LOG . info ( "Startable matcher for '%s' is: [ %s ]" % ( self . config . job_name , self . config . startable ) ) self . config . downloading = matching . ConditionParser ( engine . FieldDefinition . lookup , "name" ) . parse ( "is_active=1 is_complete=0" + ( " [ %s ]" % self . config . downloading if "downloading" in self . config else "" ) ) self . LOG . info ( "Downloading matcher for '%s' is: [ %s ]" % ( self . config . job_name , self . config . downloading ) ) self . sort_key = formatting . validate_sort_fields ( self . config . sort_fields ) if self . config . sort_fields . strip ( ) else None
Set up queue manager.