diff options
author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-09-18 14:27:15 -0300 |
---|---|---|
committer | Ivan Alejandro <ivanalejandro0@gmail.com> | 2013-09-18 18:24:20 -0300 |
commit | 6cd19c3b67d76268bab5f93d3168164ec02f603d (patch) | |
tree | e86a305064345aab3ea29c356bf281411c331bca /src/leap/bitmask/services/__init__.py | |
parent | e0734dd4c3c529c99b7c90d8db1dfb9f09551b24 (diff) |
Move STANDALONE flag to a module and unify paths queries.
Diffstat (limited to 'src/leap/bitmask/services/__init__.py')
-rw-r--r-- | src/leap/bitmask/services/__init__.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/leap/bitmask/services/__init__.py b/src/leap/bitmask/services/__init__.py index 2646235d..afce72f6 100644 --- a/src/leap/bitmask/services/__init__.py +++ b/src/leap/bitmask/services/__init__.py @@ -22,10 +22,12 @@ import os from PySide import QtCore +from leap.bitmask.config import flags from leap.bitmask.crypto.srpauth import SRPAuth from leap.bitmask.util.constants import REQUEST_TIMEOUT from leap.bitmask.util.privilege_policies import is_missing_policy_permissions from leap.bitmask.util.request_helpers import get_content +from leap.bitmask.util import get_path_prefix from leap.common.check import leap_assert from leap.common.config.baseconfig import BaseConfig @@ -37,7 +39,7 @@ logger = logging.getLogger(__name__) DEPLOYED = ["openvpn", "mx"] -def get_service_display_name(service, standalone=False): +def get_service_display_name(service): """ Returns the name to display of the given service. If there is no configured name for that service, then returns the same @@ -45,9 +47,6 @@ def get_service_display_name(service, standalone=False): :param service: the 'machine' service name :type service: str - :param standalone: True if the app is running in a standalone mode, used - to display messages according that. - :type standalone: bool :rtype: str """ @@ -67,7 +66,7 @@ def get_service_display_name(service, standalone=False): # administrative permissions to start. That can be either # because we are running in standalone mode, or because we could # not find the needed privilege escalation mechanisms being operative. - if standalone or is_missing_policy_permissions(): + if flags.STANDALONE or is_missing_policy_permissions(): EIP_LABEL += " " + _tr("(will need admin password to start)") return service_display.get(service, service) @@ -106,9 +105,8 @@ def download_service_config(provider_config, service_config, service_name = service_config.name service_json = "{0}-service.json".format(service_name) headers = {} - mtime = get_mtime(os.path.join(service_config.get_path_prefix(), - "leap", - "providers", + mtime = get_mtime(os.path.join(get_path_prefix(), + "leap", "providers", provider_config.get_domain(), service_json)) if download_if_needed and mtime: |