1
#========================================================================
2
# This file is part of Revision Monitor application.
4
# Copyright (C) 2012 Sasa Stamenkovic <umpirsky@gmail.com>
6
# For the full copyright and license information, please view the LICENSE
7
# file that was distributed with this source code.
8
#========================================================================
11
'project_path_not_found',
16
# Where your project will look for your data (for instance, images and ui
17
# files). By default, this is ../data, relative your trunk layout
18
__revision_monitor_data_directory__ = '../data/'
25
from gettext import gettext as _
26
gettext.textdomain('revision-monitor')
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 revision-monitor data path
45
This path is by default <revision_monitor_lib_path>/../data/ in trunk
46
and /usr/share/revision-monitor in an installed version but this path
47
is specified at installation time.
50
# Get pathname absolute or relative.
52
os.path.dirname(__file__), __revision_monitor_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