Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/datastore/datastore.py
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2010-08-09 07:25:18 (GMT)
committer Simon Schampijer <simon@schampijer.de>2010-08-09 07:25:18 (GMT)
commitf82c2bad4d4c6d9e50d4fda93da5717500c42a6d (patch)
treebc264900a67bb8b539ee6d5e44bb4322a29f2702 /src/sugar/datastore/datastore.py
parente065eef05905e9f306d1e85207441c0c203dad85 (diff)
Not able to access files on external device from within an activity on new system d.l.o #10218
The error we were seeing was that the '(env.get_profile_path(), 'data'))' does not exist yet at system start. Symlinks are created there when accessing data on an external device. The directory gets created when an activity like Browse or Terminal has been run for the first time or you start Read for the first time by resuming the file on the external device. http://dev.laptop.org/ticket/10218
Diffstat (limited to 'src/sugar/datastore/datastore.py')
-rw-r--r--src/sugar/datastore/datastore.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sugar/datastore/datastore.py b/src/sugar/datastore/datastore.py
index 1618cef..656afcc 100644
--- a/src/sugar/datastore/datastore.py
+++ b/src/sugar/datastore/datastore.py
@@ -250,9 +250,11 @@ class RawObject(object):
# to create hardlinks to jobject files
# and w/o this, it wouldn't work since we have file from mounted device
if self._file_path is None:
+ data_path = os.path.join(env.get_profile_path(), 'data')
self._file_path = tempfile.mktemp(
- prefix='rawobject',
- dir=os.path.join(env.get_profile_path(), 'data'))
+ prefix='rawobject', dir=data_path)
+ if not os.path.exists(data_path):
+ os.makedirs(data_path)
os.symlink(self.object_id, self._file_path)
return self._file_path