From 6c5d28ecf516cca2ad317983fade3dbf0061d6e6 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 09 Mar 2007 16:29:03 +0000 Subject: Save also the sugar session display and use it in sugar-activity. --- (limited to 'sugar') 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') -- cgit v0.9.1