Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/service
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2008-02-05 00:21:55 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2008-02-05 00:21:55 (GMT)
commit44efc2a1315efe90eb2edc7a24b1372382222408 (patch)
tree565b8baf5cace68ec0462077506012e04c8ad108 /service
parentaca3ae6c88eb56b4dd2f818928ecca5064669978 (diff)
Complete paths cleanup and remove SUGAR_PREFIX and
SUGAR_PATH environment variables.
Diffstat (limited to 'service')
-rw-r--r--service/.gitignore1
-rw-r--r--service/Makefile.am1
-rw-r--r--service/bundleregistry.py4
-rw-r--r--service/config.py.in17
4 files changed, 22 insertions, 1 deletions
diff --git a/service/.gitignore b/service/.gitignore
new file mode 100644
index 0000000..4acd06b
--- /dev/null
+++ b/service/.gitignore
@@ -0,0 +1 @@
+config.py
diff --git a/service/Makefile.am b/service/Makefile.am
index 17ac9f7..fa8e66f 100644
--- a/service/Makefile.am
+++ b/service/Makefile.am
@@ -25,6 +25,7 @@ sugar_PYTHON = \
bundleregistry.py \
clipboardobject.py \
clipboardservice.py \
+ config.py \
main.py
DISTCLEANFILES = $(service_DATA)
diff --git a/service/bundleregistry.py b/service/bundleregistry.py
index 8dd141c..25a3440 100644
--- a/service/bundleregistry.py
+++ b/service/bundleregistry.py
@@ -24,6 +24,8 @@ from sugar.bundle.bundle import MalformedBundleException
from sugar import env
from sugar import util
+import config
+
# http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
def _get_data_dirs():
if os.environ.has_key('XDG_DATA_DIRS'):
@@ -34,7 +36,7 @@ def _get_data_dirs():
def _load_mime_defaults():
defaults = {}
- f = open(env.get_data_path('mime.defaults'), 'r')
+ f = open(os.path.join(config.data_path, 'mime.defaults'), 'r')
for line in f.readlines():
line = line.strip()
if line and not line.startswith('#'):
diff --git a/service/config.py.in b/service/config.py.in
new file mode 100644
index 0000000..c617d7e
--- /dev/null
+++ b/service/config.py.in
@@ -0,0 +1,17 @@
+# Copyright (C) 2008 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+data_path = '@prefix@/share/sugar/data'