diff options
Diffstat (limited to 'service')
-rw-r--r-- | service/.gitignore | 1 | ||||
-rw-r--r-- | service/Makefile.am | 1 | ||||
-rw-r--r-- | service/bundleregistry.py | 4 | ||||
-rw-r--r-- | service/config.py.in | 17 |
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' |