(self)
prepare self.processes, which is a descriptor dictionary in
        pg_name: {
            exe: [regex],
            name: [regex],
            cmdline: [regex],
            selfmon: [boolean],
            procs: [psutil.Process],
            count_workers: [boolean]
        }
prepare self.processes, which is a descriptor dictionary in
        pg_name: {
            exe: [regex],
            name: [regex],
            cmdline: [regex],
            selfmon: [boolean],
            procs: [psutil.Process],
            count_workers: [boolean]
        }
prepare self . processes which is a descriptor dictionary in pg_name : { exe : [ regex ] name : [ regex ] cmdline : [ regex ] selfmon : [ boolean ] procs : [ psutil . Process ] count_workers : [ boolean ] }
def process_config(self):
        super(ProcessResourcesCollector, self).process_config()
        """
        prepare self.processes, which is a descriptor dictionary in
        pg_name: {
            exe: [regex],
            name: [regex],
            cmdline: [regex],
            selfmon: [boolean],
            procs: [psutil.Process],
            count_workers: [boolean]
        }
        """
        self.processes = {}
        self.processes_info = {}
        for pg_name, cfg in self.config['process'].items():
            pg_cfg = {}
            for key in ('exe', 'name', 'cmdline'):
                pg_cfg[key] = cfg.get(key, [])
                if not isinstance(pg_cfg[key], list):
                    pg_cfg[key] = [pg_cfg[key]]
                pg_cfg[key] = [re.compile(e) for e in pg_cfg[key]]
            pg_cfg['selfmon'] = cfg.get('selfmon', '').lower() == 'true'
            pg_cfg['count_workers'] = cfg.get(
                'count_workers', '').lower() == 'true'
            self.processes[pg_name] = pg_cfg
            self.processes_info[pg_name] = {}
def process_config ( self ) : super ( ProcessResourcesCollector , self ) . process_config ( ) self . processes = { } self . processes_info = { } for pg_name , cfg in self . config [ 'process' ] . items ( ) : pg_cfg = { } for key in ( 'exe' , 'name' , 'cmdline' ) : pg_cfg [ key ] = cfg . get ( key , [ ] ) if not isinstance ( pg_cfg [ key ] , list ) : pg_cfg [ key ] = [ pg_cfg [ key ] ] pg_cfg [ key ] = [ re . compile ( e ) for e in pg_cfg [ key ] ] pg_cfg [ 'selfmon' ] = cfg . get ( 'selfmon' , '' ) . lower ( ) == 'true' pg_cfg [ 'count_workers' ] = cfg . get ( 'count_workers' , '' ) . lower ( ) == 'true' self . processes [ pg_name ] = pg_cfg self . processes_info [ pg_name ] = { }