Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-03-09 16:29:03 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-03-09 16:29:03 (GMT)
commit6c5d28ecf516cca2ad317983fade3dbf0061d6e6 (patch)
tree2bcc93351c62201baedd738c46bfceffe6fd12f6 /sugar
parenta5d303f9ff96cb17a4fb10e611314e7c1c440c7e (diff)
Save also the sugar session display and use it in sugar-activity.
Diffstat (limited to 'sugar')
-rw-r--r--sugar/env.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/sugar/env.py b/sugar/env.py
index 65fd1fe..4cdaf2c 100644
--- a/sugar/env.py
+++ b/sugar/env.py
@@ -34,20 +34,23 @@ def is_emulator():
return True
return False
-def get_profile_path():
+def get_profile_path(path=None):
if os.environ.has_key('SUGAR_PROFILE'):
profile_id = os.environ['SUGAR_PROFILE']
else:
profile_id = 'default'
- path = os.path.join(os.path.expanduser('~/.sugar'), profile_id)
- if not os.path.isdir(path):
+ base = os.path.join(os.path.expanduser('~/.sugar'), profile_id)
+ if not os.path.isdir(base):
try:
- os.makedirs(path)
+ os.makedirs(base)
except OSError, exc:
print "Could not create user directory."
- return path
+ if path != None:
+ return os.path.join(base, path)
+ else:
+ return base
def get_user_activities_path():
path = os.path.expanduser('~/Activities')