~ubuntu-branches/ubuntu/trusty/pitivi/trusty

« back to all changes in this revision

Viewing changes to pitivi/configure.py.in

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2011-07-07 13:43:47 UTC
  • mto: (6.1.9 sid) (1.2.12)
  • mto: This revision was merged to the branch mainline in revision 32.
  • Revision ID: james.westby@ubuntu.com-20110707134347-cari9kxjiakzej9z
Tags: upstream-0.14.1
ImportĀ upstreamĀ versionĀ 0.14.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
#
17
17
# You should have received a copy of the GNU Lesser General Public
18
18
# License along with this program; if not, write to the
19
 
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
 
# Boston, MA 02111-1307, USA.
 
19
# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 
20
# Boston, MA 02110-1301, USA.
21
21
"""
22
22
Utilities for getting the location of various directories.
23
23
Enables identical use for installed and uninstalled versions.
27
27
 
28
28
LIBDIR = '@LIBDIR@'
29
29
PKGDATADIR = '@DATADIR@/@PACKAGE@'
30
 
PIXMAPDIR = '@DATADIR@/pixmaps'
31
30
pitivi_version = '@VERSION@'
32
31
APPNAME = '@PACKAGE_NAME@'
33
32
APPURL = 'http://www.pitivi.org/'
43
42
 
44
43
def _in_devel():
45
44
    rd = _get_root_dir()
46
 
    return (os.path.exists(os.path.join(rd, '.svn')) or
47
 
            os.path.exists(os.path.join(rd, 'CVS')) or
48
 
            os.path.exists(os.path.join(rd, '.git')))
 
45
    return os.path.exists(os.path.join(rd, '.git'))
 
46
 
 
47
def get_data_dir():
 
48
    if _in_devel():
 
49
        datadir = os.path.join(_get_root_dir(), "data")
 
50
    elif os.getenv("PITIVI_TOP_LEVEL_DIR"):
 
51
        top_level = os.getenv("PITIVI_TOP_LEVEL_DIR")
 
52
        datadir = os.path.join(top_level, "data")
 
53
    else:
 
54
        datadir = PKGDATADIR
 
55
    return os.path.abspath(datadir)
49
56
 
50
57
def get_pixmap_dir():
51
58
    """ Returns the directory for program-only pixmaps """
52
 
    _dir = os.path.dirname(os.path.abspath(__file__))
53
 
    if _in_devel():
54
 
        root = _dir
55
 
    elif os.getenv("PITIVI_TOP_LEVEL_DIR"):
56
 
        top_level = os.getenv("PITIVI_TOP_LEVEL_DIR")
57
 
        root = os.path.abspath(os.path.join(top_level, "pitivi"))
58
 
    else:
59
 
        root = PKGDATADIR
60
 
    return os.path.join(root, 'pixmaps')
 
59
    return os.path.join(get_data_dir(), 'pixmaps')
61
60
 
62
 
def get_global_pixmap_dir():
63
 
    """ Returns the directory for global pixmaps (ex : application icon) """
64
 
    if _in_devel():
65
 
        root = _get_root_dir()
66
 
    else:
67
 
        root = PIXMAPDIR
68
 
    return root
 
61
def get_ui_dir():
 
62
    """ Returns the directory for GtkBuilder/Glade files """
 
63
    return os.path.join(get_data_dir(), 'ui')