1
# -*- coding: utf-8 -*-
3
# This file is in the public domain
6
# THIS IS Grumble CONFIGURATION FILE
7
# YOU CAN PUT THERE SOME GLOBAL VALUE
8
# Do not touch unless you know what you're doing.
12
'project_path_not_found',
17
# Where your project will look for your data (for instance, images and ui
18
# files). By default, this is ../data, relative your trunk layout
19
__grumble_data_directory__ = '../data/'
25
from gettext import gettext as _
26
gettext.textdomain('grumble')
28
class project_path_not_found(Exception):
29
"""Raised when we can't find the project directory."""
32
def get_data_file(*path_segments):
33
"""Get the full path to a data file.
35
Returns the path to a file underneath the data directory (as defined by
36
`get_data_path`). Equivalent to os.path.join(get_data_path(),
39
return os.path.join(get_data_path(), *path_segments)
43
"""Retrieve grumble data path
45
This path is by default <grumble_lib_path>/../data/ in trunk
46
and /usr/share/grumble in an installed version but this path
47
is specified at installation time.
50
# Get pathname absolute or relative.
52
os.path.dirname(__file__), __grumble_data_directory__)
54
abs_data_path = os.path.abspath(path)
55
if not os.path.exists(abs_data_path):
56
raise project_path_not_found