Save also the sugar session display and use it in sugar-activity.

This commit is contained in:
Marco Pesenti Gritti
2007-03-09 17:29:03 +01:00
parent a5d303f9ff
commit 6c5d28ecf5
3 changed files with 27 additions and 18 deletions
+8 -5
View File
@@ -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')