1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
4
# J Phani Mahesh <phanimahesh@gmail.com>
5
# Barneedhar (jokerdino) <barneedhar@ubuntu.com>
6
# Amith KK <amithkumaran@gmail.com>
7
# Georgi Karavasilev <motorslav@gmail.com>
8
# Sam Tran <samvtran@gmail.com>
9
# Sam Hewitt <hewittsamuel@gmail.com>
10
# Angel Araya <al.arayaq@gmail.com>
13
# A One-stop configuration tool for Unity.
17
# This file is a part of Unity Tweak Tool
19
# Unity Tweak Tool is free software; you can redistribute it and/or modify it under
20
# the terms of the GNU General Public License as published by the Free Software
21
# Foundation; version 3.
23
# Unity Tweak Tool is distributed in the hope that it will be useful, but WITHOUT
24
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
25
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
28
# You should have received a copy of the GNU General Public License along with
29
# this program; if not, see <https://www.gnu.org/licenses/gpl-3.0.txt>
32
'project_path_not_found',
37
# Where your project will look for your data (for instance, images and ui
38
# files). By default, this is ../data, relative your trunk layout
39
__unity_tweak_tool_data_directory__ = '../../data/'
45
from locale import gettext as _
47
class project_path_not_found(Exception):
48
"""Raised when we can't find the project directory."""
51
def get_data_file(*path_segments):
52
"""Get the full path to a data file.
54
Returns the path to a file underneath the data directory (as defined by
55
`get_data_path`). Equivalent to os.path.join(get_data_path(),
58
return os.path.join(get_data_path(), *path_segments)
62
"""Retrieve unity-tweak-tool data path"""
64
# Get pathname absolute or relative.
66
os.path.dirname(__file__), __unity_tweak_tool_data_directory__)
68
abs_data_path = os.path.abspath(path)
69
if not os.path.exists(abs_data_path):
70
raise project_path_not_found