summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/config
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2013-10-02 16:41:23 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2013-10-03 10:14:50 -0300
commit40161f730310d18756123e53ea29f724eea59730 (patch)
treec21bbe1e7c781579065eba82e86f4d7875034ad7 /src/leap/bitmask/config
parentd4192fce8317372869005ce2b5c455d10763e058 (diff)
Separate pre-seeded providers from user added ones
Diffstat (limited to 'src/leap/bitmask/config')
-rw-r--r--src/leap/bitmask/config/leapsettings.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/leap/bitmask/config/leapsettings.py b/src/leap/bitmask/config/leapsettings.py
index 338fa475..7ab1ace3 100644
--- a/src/leap/bitmask/config/leapsettings.py
+++ b/src/leap/bitmask/config/leapsettings.py
@@ -67,6 +67,7 @@ class LeapSettings(object):
DEFAULTPROVIDER_KEY = "DefaultProvider"
ALERTMISSING_KEY = "AlertMissingScripts"
GATEWAY_KEY = "Gateway"
+ PINNED_KEY = "Pinned"
# values
GATEWAY_AUTOMATIC = "Automatic"
@@ -134,6 +135,22 @@ class LeapSettings(object):
return providers
+ def is_pinned_provider(self, domain):
+ """
+ Returns True if the domain 'domain' is pinned with the application.
+ False otherwise.
+
+ :param provider: provider domain
+ :type provider: str
+
+ :rtype: bool
+ """
+ leap_assert(len(domain) > 0, "We need a nonempty domain.")
+ pinned_key = "{0}/{1}".format(domain, self.PINNED_KEY)
+ result = to_bool(self._settings.value(pinned_key, False))
+
+ return result
+
def get_selected_gateway(self, provider):
"""
Returns the configured gateway for the given provider.