summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/provider/__init__.py
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2014-01-07 18:25:21 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2014-01-09 14:27:41 -0300
commit74397ee78ab7f01cb622b0e06b3de901a3604f0b (patch)
tree94739dfba9f50652d7907faaa019b4b55ab8e0da /src/leap/bitmask/provider/__init__.py
parentdf0d02a565631693f62e99abb2b4be8b8bd450f5 (diff)
Warn the user if is using an old app version.
[Closes #4636]
Diffstat (limited to 'src/leap/bitmask/provider/__init__.py')
-rw-r--r--src/leap/bitmask/provider/__init__.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/leap/bitmask/provider/__init__.py b/src/leap/bitmask/provider/__init__.py
index 53587d65..68f3ded0 100644
--- a/src/leap/bitmask/provider/__init__.py
+++ b/src/leap/bitmask/provider/__init__.py
@@ -18,6 +18,10 @@
Module initialization for leap.bitmask.provider
"""
import os
+
+from distutils.version import LooseVersion
+
+from leap.bitmask import __version__ as BITMASK_VERSION
from leap.common.check import leap_assert
@@ -32,3 +36,21 @@ def get_provider_path(domain):
"""
leap_assert(domain is not None, "get_provider_path: We need a domain")
return os.path.join("leap", "providers", domain, "provider.json")
+
+
+class SupportedClient(object):
+ """
+ Class responsible of checking for client compatibility.
+ """
+
+ @classmethod
+ def supports(self, minimum_version):
+ """
+ :param minimum_version: the version number of the client that
+ we need to check.
+ :type minimum_version: str
+
+ :returns: True if that version is supported or False otherwise.
+ :return type: bool
+ """
+ return LooseVersion(minimum_version) <= LooseVersion(BITMASK_VERSION)