5
# Copyright (c) 2005, Edward Hervey <bilboed@bilboed.com>
7
# This program is free software; you can redistribute it and/or
8
# modify it under the terms of the GNU Lesser General Public
9
# License as published by the Free Software Foundation; either
10
# version 2.1 of the License, or (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
# Lesser General Public License for more details.
17
# You should have received a copy of the GNU Lesser General Public
18
# License along with this program; if not, write to the
19
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
20
# Boston, MA 02110-1301, USA.
22
Utilities for getting the location of various directories.
23
Enables identical use for installed and uninstalled versions.
29
# Again, mostly the same thing as in bin/pitivi.in and pitivi/utils/misc.py:
31
return '/'.join(os.path.dirname(os.path.abspath(__file__)).split('/')[:-1])
36
Returns whether the app is run from a git checkout.
39
return os.path.exists(os.path.join(rd, '.git'))
43
PKGDATADIR = '@DATADIR@/@PACKAGE@'
45
APPNAME = '@PACKAGE_NAME@'
46
APPURL = 'http://www.pitivi.org/'
47
RELEASES_URL = 'http://pitivi.org/releases.txt'
48
APPMANUALURL_ONLINE = 'http://www.pitivi.org/manual'
52
APPMANUALURL_OFFLINE = 'ghelp://%s' % os.path.join(_get_root_dir(), 'help/C')
54
APPMANUALURL_OFFLINE = 'help:pitivi'
59
datadir = os.path.join(_get_root_dir(), "data")
60
elif os.getenv("PITIVI_TOP_LEVEL_DIR"):
61
top_level = os.getenv("PITIVI_TOP_LEVEL_DIR")
62
datadir = os.path.join(top_level, "data")
65
return os.path.abspath(datadir)
69
""" Returns the directory for program-only pixmaps """
70
return os.path.join(get_data_dir(), 'pixmaps')
74
""" Returns the directory for GtkBuilder/Glade files """
75
return os.path.join(get_data_dir(), 'ui')
78
def get_renderpresets_dir():
79
""" Returns the directory for Render Presets files """
80
return os.path.join(get_data_dir(), 'renderpresets')
83
def get_audiopresets_dir():
84
""" Returns the directory for Audio Presets files """
85
return os.path.join(get_data_dir(), 'audiopresets')
88
def get_videopresets_dir():
89
""" Returns the directory for Video Presets files """
90
return os.path.join(get_data_dir(), 'videopresets')