Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@sugarlabs.org>2012-08-15 15:47:28 (GMT)
committer Aleksey Lim <alsroot@sugarlabs.org>2012-08-15 15:47:28 (GMT)
commitdfcd49723178cb4c29aeb1800c7bb34d65cb9807 (patch)
tree57a4b1f41560b676842f6db728d6de64b88703f6
parent271721c0b24e64eab03f6b5f549094a4010d4393 (diff)
Activity directories might be symlinks
-rw-r--r--sugar_network/local/mounts.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/sugar_network/local/mounts.py b/sugar_network/local/mounts.py
index 6d75740..8318627 100644
--- a/sugar_network/local/mounts.py
+++ b/sugar_network/local/mounts.py
@@ -18,7 +18,7 @@ import json
import shutil
import logging
from urlparse import urlparse
-from os.path import isabs, exists, join, basename
+from os.path import isabs, exists, join, basename, isdir
from gettext import gettext as _
import sweets_recipe
@@ -177,7 +177,10 @@ class HomeMount(LocalMount):
def _checkout(self, guid):
for path in activities.checkins(guid):
_logger.info('Checkout %r implementation from %r', guid, path)
- shutil.rmtree(path)
+ if isdir(path):
+ shutil.rmtree(path)
+ else:
+ os.unlink(path)
class _ProxyCommands(object):
@@ -377,6 +380,7 @@ class RemoteMount(ad.CommandsProcessor, _Mount, _ProxyCommands):
def listen_events(url, conn):
stat = http.request('GET', [], params={'cmd': 'stat'},
headers={'Content-Type': 'application/json'})
+ # pylint: disable-msg=E1103
self._seqno = stat.get('seqno') or 0
self._remote_volume_guid = stat.get('guid')