Add a way to get user dir
This commit is contained in:
parent
41ec035dc7
commit
2174b6e0fd
@ -1,4 +1,4 @@
|
|||||||
AC_INIT([Sugar],[0.4],[],[sugar])
|
AC_INIT([Sugar],[0.5],[],[sugar])
|
||||||
|
|
||||||
AC_PREREQ([2.59])
|
AC_PREREQ([2.59])
|
||||||
|
|
||||||
|
@ -322,6 +322,8 @@ class BrowserShell(dbus.service.Object):
|
|||||||
get_instance = staticmethod(get_instance)
|
get_instance = staticmethod(get_instance)
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
geckoembed.set_profile_path(sugar.env.get_user_dir())
|
||||||
|
|
||||||
session_bus = dbus.SessionBus()
|
session_bus = dbus.SessionBus()
|
||||||
bus_name = dbus.service.BusName('com.redhat.Sugar.Browser', bus=session_bus)
|
bus_name = dbus.service.BusName('com.redhat.Sugar.Browser', bus=session_bus)
|
||||||
object_path = '/com/redhat/Sugar/Browser'
|
object_path = '/com/redhat/Sugar/Browser'
|
||||||
|
@ -4,6 +4,9 @@ try:
|
|||||||
from sugar.__uninstalled__ import *
|
from sugar.__uninstalled__ import *
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from sugar.__installed__ import *
|
from sugar.__installed__ import *
|
||||||
|
|
||||||
|
def get_user_dir():
|
||||||
|
return os.path.expanduser('~/.sugar/')
|
||||||
|
|
||||||
def get_data_file(filename):
|
def get_data_file(filename):
|
||||||
for data_dir in get_data_dirs():
|
for data_dir in get_data_dirs():
|
||||||
|
@ -20,7 +20,7 @@ def start(console):
|
|||||||
act_dir = os.path.join(data_dir, env.get_activities_dir())
|
act_dir = os.path.join(data_dir, env.get_activities_dir())
|
||||||
activities_dirs.append(act_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:
|
for activities_dir in activities_dirs:
|
||||||
if os.path.isdir(activities_dir):
|
if os.path.isdir(activities_dir):
|
||||||
|
Loading…
Reference in New Issue
Block a user