Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2007-04-10 19:22:28 (GMT)
committer Dan Williams <dcbw@redhat.com>2007-04-10 19:22:28 (GMT)
commit133a718f285d9a5182ef19ce302bcdb822f14e7d (patch)
treef26bc6721710bd0de860ebb7ba0731048d39341c /services
parenta4792552f4899caeb809f477d66b2ae31bda50ef (diff)
Really fix cache code this time; revert to previous code plus ensure directory exists
Diffstat (limited to 'services')
-rw-r--r--services/presence/buddyiconcache.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/services/presence/buddyiconcache.py b/services/presence/buddyiconcache.py
index a7cee3b..c647fa8 100644
--- a/services/presence/buddyiconcache.py
+++ b/services/presence/buddyiconcache.py
@@ -27,10 +27,17 @@ class BuddyIconCache(object):
ppath = env.get_profile_path()
self._cachepath = os.path.join(ppath, "cache", "buddy-icons", "cache")
- if not os.path.exists(self._cachepath):
- os.makedirs(self._cachepath)
+ # Ensure cache directory exists
+ if not os.path.exists(os.path.dirname(self._cachepath)):
+ os.makedirs(os.path.dirname(self._cachepath))
- self._load_cache()
+ if not os.path.exists(self._cachepath):
+ self._cache = {}
+ # md5 and server token of the last avatar uploaded
+ self._md5 = ''
+ self._token = ''
+ else:
+ self._load_cache()
def _load_cache(self):
try: