1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
3
# Copyright (C) 2012 David Planella <david.planella@ubuntu.com>
4
# Copyright (C) 2012 Michael Hall <mhall119@ubuntu.com>
5
# This program is free software: you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 3, as published
7
# by the Free Software Foundation.
9
# This program is distributed in the hope that it will be useful, but
10
# WITHOUT ANY WARRANTY; without even the implied warranties of
11
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12
# PURPOSE. See the GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License along
15
# with this program. If not, see <http://www.gnu.org/licenses/>.
18
# THIS IS Qreator CONFIGURATION FILE
19
# YOU CAN PUT THERE SOME GLOBAL VALUE
20
# Do not touch unless you know what you're doing.
24
'project_path_not_found',
29
# Where your project will look for your data (for instance, images and ui
30
# files). By default, this is ../data, relative your trunk layout
31
__qreator_data_directory__ = '../data/'
33
__version__ = 'VERSION'
38
from gettext import gettext as _
39
gettext.textdomain('qreator')
41
class project_path_not_found(Exception):
42
"""Raised when we can't find the project directory."""
45
def get_data_file(*path_segments):
46
"""Get the full path to a data file.
48
Returns the path to a file underneath the data directory (as defined by
49
`get_data_path`). Equivalent to os.path.join(get_data_path(),
52
return os.path.join(get_data_path(), *path_segments)
56
"""Retrieve qreator data path
58
This path is by default <qreator_lib_path>/../data/ in trunk
59
and /usr/share/qreator in an installed version but this path
60
is specified at installation time.
63
# Get pathname absolute or relative.
65
os.path.dirname(__file__), __qreator_data_directory__)
67
abs_data_path = os.path.abspath(path)
68
if not os.path.exists(abs_data_path):
69
raise project_path_not_found