diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-09-30 12:14:23 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-10-01 11:22:39 -0300 |
commit | 10d59e81c9ae5275a92d041e36c61a0628b726f0 (patch) | |
tree | 1f6e0f9060658ba9f6706cf0c4967334d6cd7063 /src/leap/bitmask/config/providerconfig.py | |
parent | 487993d08cc2e12fdb9c9edcddff5727479e815d (diff) |
Implement new UI
Also:
- Remove status_panel
- Add new icons
- Refactor components a bit (mostly divide functionality)
Diffstat (limited to 'src/leap/bitmask/config/providerconfig.py')
-rw-r--r-- | src/leap/bitmask/config/providerconfig.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/leap/bitmask/config/providerconfig.py b/src/leap/bitmask/config/providerconfig.py index c8c8a59e..44698d83 100644 --- a/src/leap/bitmask/config/providerconfig.py +++ b/src/leap/bitmask/config/providerconfig.py @@ -44,6 +44,25 @@ class ProviderConfig(BaseConfig): def __init__(self): BaseConfig.__init__(self) + @classmethod + def get_provider_config(self, domain): + """ + Helper to return a valid Provider Config from the domain name. + + :param domain: the domain name of the provider. + :type domain: str + + :rtype: ProviderConfig or None if there is a problem loading the config + """ + provider_config = ProviderConfig() + provider_config_path = os.path.join( + "leap", "providers", domain, "provider.json") + + if not provider_config.load(provider_config_path): + provider_config = None + + return provider_config + def _get_schema(self): """ Returns the schema corresponding to the version given. |