def parse_config(cls, config): """Parse config data from a config file We call the super's parse_config first to update it with our additional values. """ conf = OpenIDResponder.parse_config(config) params = {} key_map = {'Consumer Key': 'consumer', 'Consumer Secret': 'oauth_secret', 'Realm': 'realm', 'Endpoint Regex': 'endpoint_regex'} yahoo_vals = config['Yahoo'] if not isinstance(yahoo_vals, dict): return conf for k, v in key_map.items(): if k in yahoo_vals: params[v] = yahoo_vals[k] conf.update(params) return conf
def parse_config(cls, config): """Parse config data from a config file We call the super's parse_config first to update it with our additional values. """ conf = OpenIDResponder.parse_config(config) params = {} key_map = {'OAuth Consumer Key': 'consumer', 'OAuth Consumer Secret': 'oauth_secret', 'Protocol': 'protocol', 'Realm': 'realm', 'Endpoint Regex': 'endpoint_regex', "Request Attributes": 'request_attributes' } google_vals = config['Google'] if not isinstance(google_vals, dict): return conf for k, v in key_map.items(): if k in google_vals: params[v] = google_vals[k] conf.update(params) if 'Schema' in config['OpenID'] and config['OpenID']['Schema'] in globals(): globals()["attributes"] = globals()[config['OpenID']['Schema']] return conf