summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/backend/settings.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2015-02-11 23:46:42 -0400
committerIvan Alejandro <ivanalejandro0@gmail.com>2015-02-13 14:01:45 -0300
commite52f9a239a146c06a0683e47eaf9d53f4deb332b (patch)
tree888f58e1e43c324147abe2d64295f3921beb0be7 /src/leap/bitmask/backend/settings.py
parentc8b5865364ffabc5400642684050286c5c836352 (diff)
enable --offline mode for email again
Diffstat (limited to 'src/leap/bitmask/backend/settings.py')
-rw-r--r--src/leap/bitmask/backend/settings.py27
1 files changed, 13 insertions, 14 deletions
diff --git a/src/leap/bitmask/backend/settings.py b/src/leap/bitmask/backend/settings.py
index 5cb4c616..ed70ca6b 100644
--- a/src/leap/bitmask/backend/settings.py
+++ b/src/leap/bitmask/backend/settings.py
@@ -122,37 +122,36 @@ class Settings(object):
self._settings.set(provider, self.GATEWAY_KEY, gateway)
self._save()
- def get_uuid(self, username):
+ def get_uuid(self, full_user_id):
"""
Gets the uuid for a given username.
- :param username: the full user identifier in the form user@provider
- :type username: basestring
+ :param full_user_id: the full user identifier in the form user@provider
+ :type full_user_id: basestring
"""
- leap_assert("@" in username,
+ leap_assert("@" in full_user_id,
"Expected username in the form user@provider")
- user, provider = username.split('@')
+ username, provider = full_user_id.split('@')
+ return self._get_value(provider, full_user_id, "")
- return self._get_value(provider, username, "")
-
- def set_uuid(self, username, value):
+ def set_uuid(self, full_user_id, value):
"""
Sets the uuid for a given username.
- :param username: the full user identifier in the form user@provider
- :type username: str or unicode
+ :param full_user_id: the full user identifier in the form user@provider
+ :type full_user_id: str or unicode
:param value: the uuid to save or None to remove it
:type value: str or unicode or None
"""
- leap_assert("@" in username,
+ leap_assert("@" in full_user_id,
"Expected username in the form user@provider")
- user, provider = username.split('@')
+ user, provider = full_user_id.split('@')
if value is None:
- self._settings.remove_option(provider, username)
+ self._settings.remove_option(provider, full_user_id)
else:
leap_assert(len(value) > 0, "We cannot save an empty uuid")
self._add_section(provider)
- self._settings.set(provider, username, value)
+ self._settings.set(provider, full_user_id, value)
self._save()