Ejemplo n.º 1
0
    def _load_config(self):
        with open(_CONFIG_FILE) as cfg_file:
            cfg = json.load(cfg_file)

            cfg['localities'] = config.Localities(**cfg['localities'])

            cfg['events'] = config.Events(**cfg['events'])

            cfg['whitelist'] = config.Whitelist(**cfg['whitelist'])

            return config.Config(**cfg)
Ejemplo n.º 2
0
    def _load_config(self):
        with open(_CONFIG_FILE) as cfg_file:
            cfg = json.load(cfg_file)

            cfg['localities'] = config.Localities(**cfg['localities'])

            cfg['events'] = config.Events(**cfg['events'])

            cfg['whitelist'] = config.Whitelist(**cfg['whitelist'])

            asn_mvmt = None
            if cfg['factors']['asn_movement'] is not None:
                asn_mvmt = config.ASNMovement(**cfg['factors']['asn_movement'])

            cfg['factors'] = config.Factors(asn_movement=asn_mvmt)

            return config.Config(**cfg)