Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu.vizoso@collabora.co.uk>2010-08-26 14:59:45 (GMT)
committer Tomeu Vizoso <tomeu.vizoso@collabora.co.uk>2010-08-26 15:07:15 (GMT)
commite21ab06e34a6964dc6422d3ed8ca4daafdd2e260 (patch)
treea9faa0d1ab1d03244582862c45b4f5a68ef78482 /src
parentd780248e87d92a3f626f12a2a051fc715f634389 (diff)
Read the public and private keys lazily
Diffstat (limited to 'src')
-rw-r--r--src/sugar/profile.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/sugar/profile.py b/src/sugar/profile.py
index 1883717..2ed5aa6 100644
--- a/src/sugar/profile.py
+++ b/src/sugar/profile.py
@@ -53,8 +53,19 @@ class Profile(object):
self._pubkey = None
self._privkey_hash = None
- self.pubkey = self._load_pubkey()
- self.privkey_hash = self._hash_private_key()
+ def _get_pubkey(self):
+ if self._pubkey is None:
+ self._pubkey = self._load_pubkey()
+ return self._pubkey
+
+ pubkey = property(fget=_get_pubkey)
+
+ def _get_privkey_hash(self):
+ if self._privkey_hash is None:
+ self._privkey_hash = self._hash_private_key()
+ return self._privkey_hash
+
+ privkey_hash = property(fget=_get_privkey_hash)
def is_valid(self):
client = gconf.client_get_default()