diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-08-22 14:15:34 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-08-22 14:15:34 (GMT) |
commit | 511fec421fd4f14f8d2d8d09ac8269101a3940ea (patch) | |
tree | 32bb06a8dccfab5464af2bd364a75ba8017e31f5 /sugar/env.py | |
parent | 3e51b086df1221a469bc98842fe779c47f4f2514 (diff) |
Simple profile support. First time dialog (ugly and only nick atm).
Diffstat (limited to 'sugar/env.py')
-rw-r--r-- | sugar/env.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/sugar/env.py b/sugar/env.py index 0caf198..4db74e8 100644 --- a/sugar/env.py +++ b/sugar/env.py @@ -44,18 +44,19 @@ def setup(): registry = sugar.conf.get_activity_registry() registry.scan_directory(get_activities_dir()) -def get_user_dir(): - if os.environ.has_key('SUGAR_NICK_NAME'): - nick = get_nick_name() - return os.path.expanduser('~/.sugar-%s/' % nick) + profile = sugar.conf.get_profile() + if os.environ.has_key('SUGAR_PROFILE'): + profile.read(os.environ['SUGAR_PROFILE']) else: - return os.path.expanduser('~/.sugar') + profile.read('default') + +def get_user_dir(): + profile = sugar.conf.get_profile() + return profile.get_path() def get_nick_name(): - if os.environ.has_key('SUGAR_NICK_NAME'): - return os.environ['SUGAR_NICK_NAME'] - else: - return pwd.getpwuid(os.getuid())[0] + profile = sugar.conf.get_profile() + return profile.get_nick_name() def get_data_dir(): return sugar_data_dir |