1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
3
# Copyright (C) 2012 Gabriele N. Tornetta <phoenix1987@gmail.com>
4
# This program is free software: you can redistribute it and/or modify it
5
# under the terms of the GNU General Public License version 3, as published
6
# by the Free Software Foundation.
8
# This program is distributed in the hope that it will be useful, but
9
# WITHOUT ANY WARRANTY; without even the implied warranties of
10
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11
# PURPOSE. See the GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License along
14
# with this program. If not, see <http://www.gnu.org/licenses/>.
17
# THIS IS Gtumbler CONFIGURATION FILE
18
# YOU CAN PUT THERE SOME GLOBAL VALUE
19
# Do not touch unless you know what you're doing.
23
'project_path_not_found',
28
# Where your project will look for your data (for instance, images and ui
29
# files). By default, this is ../data, relative your trunk layout
30
__gtumbler_data_directory__ = '../data/'
32
__version__ = 'VERSION'
37
from gettext import gettext as _
38
gettext.textdomain('gtumbler')
40
class project_path_not_found(Exception):
41
"""Raised when we can't find the project directory."""
44
def get_data_file(*path_segments):
45
"""Get the full path to a data file.
47
Returns the path to a file underneath the data directory (as defined by
48
`get_data_path`). Equivalent to os.path.join(get_data_path(),
51
return os.path.join(get_data_path(), *path_segments)
55
"""Retrieve gtumbler data path
57
This path is by default <gtumbler_lib_path>/../data/ in trunk
58
and /usr/share/gtumbler in an installed version but this path
59
is specified at installation time.
62
# Get pathname absolute or relative.
64
os.path.dirname(__file__), __gtumbler_data_directory__)
66
abs_data_path = os.path.abspath(path)
67
if not os.path.exists(abs_data_path):
68
raise project_path_not_found