From 2174b6e0fd17f4a36780e9a65a382b22e338126d Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sun, 21 May 2006 17:49:27 -0400 Subject: [PATCH] Add a way to get user dir --- configure.ac | 2 +- sugar/browser/browser.py | 2 ++ sugar/env.py | 3 +++ sugar/session/session.py | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 434bd514..a32b2206 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([Sugar],[0.4],[],[sugar]) +AC_INIT([Sugar],[0.5],[],[sugar]) AC_PREREQ([2.59]) diff --git a/sugar/browser/browser.py b/sugar/browser/browser.py index cec6e096..1bc61608 100755 --- a/sugar/browser/browser.py +++ b/sugar/browser/browser.py @@ -322,6 +322,8 @@ class BrowserShell(dbus.service.Object): get_instance = staticmethod(get_instance) def __init__(self): + geckoembed.set_profile_path(sugar.env.get_user_dir()) + session_bus = dbus.SessionBus() bus_name = dbus.service.BusName('com.redhat.Sugar.Browser', bus=session_bus) object_path = '/com/redhat/Sugar/Browser' diff --git a/sugar/env.py b/sugar/env.py index 9359409b..ffea539a 100644 --- a/sugar/env.py +++ b/sugar/env.py @@ -4,6 +4,9 @@ try: from sugar.__uninstalled__ import * except ImportError: from sugar.__installed__ import * + +def get_user_dir(): + return os.path.expanduser('~/.sugar/') def get_data_file(filename): for data_dir in get_data_dirs(): diff --git a/sugar/session/session.py b/sugar/session/session.py index df0a0db4..4d57a208 100644 --- a/sugar/session/session.py +++ b/sugar/session/session.py @@ -20,7 +20,7 @@ def start(console): act_dir = os.path.join(data_dir, env.get_activities_dir()) activities_dirs.append(act_dir) - activities_dirs.append(os.path.expanduser('~/.sugar/activities')) + activities_dirs.append(os.path.join(env.get_user_dir(), 'activities')) for activities_dir in activities_dirs: if os.path.isdir(activities_dir):