Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2006-11-03 07:39:21 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2006-11-03 07:39:21 (GMT)
commitc7dbfdb067d200903fe6805ab59ed6b7129b129a (patch)
treee9b53bacf279078afb4c202a92e2a60a3516b89c /sugar
parenta6503b8bd8092112323f06c5ab29337a01753597 (diff)
parent561169809b92e29cfd762c3cd673def881764dcc (diff)
Merge branch 'master' of git://dev.laptop.org/sugar
Diffstat (limited to 'sugar')
-rw-r--r--sugar/activity/bundleregistry.py7
-rw-r--r--sugar/env.py12
2 files changed, 17 insertions, 2 deletions
diff --git a/sugar/activity/bundleregistry.py b/sugar/activity/bundleregistry.py
index 582c340..c6d0531 100644
--- a/sugar/activity/bundleregistry.py
+++ b/sugar/activity/bundleregistry.py
@@ -10,10 +10,13 @@ class _ServiceParser(ConfigParser):
class _ServiceManager(object):
def __init__(self):
- self._path = '/tmp/sugar-services'
+ if env.get_dbus_version() < '0.95':
+ self._path = '/tmp/sugar-services'
+ else:
+ self._path = os.path.expanduser('~/.local/share/dbus-1/services')
if not os.path.isdir(self._path):
- os.mkdir(self._path)
+ os.makedirs(self._path)
def add(self, bundle):
name = bundle.get_service_name()
diff --git a/sugar/env.py b/sugar/env.py
index f776865..3f958b2 100644
--- a/sugar/env.py
+++ b/sugar/env.py
@@ -56,3 +56,15 @@ def get_dbus_config():
def get_shell_bin_dir():
return sugar_shell_bin_dir
+
+_dbus_version = None
+def get_dbus_version():
+ global _dbus_version
+ if _dbus_version == None:
+ f = os.popen('dbus-daemon --version')
+ version_line = f.readline()
+ if version_line:
+ splitted_line = version_line.split()
+ _dbus_version = splitted_line[len(splitted_line) - 1]
+ f.close()
+ return _dbus_version