File: __init__.py

package info (click to toggle)
groundcontrol 1.6.6-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,296 kB
  • ctags: 670
  • sloc: python: 3,486; sh: 26; makefile: 11
file content (56 lines) | stat: -rw-r--r-- 1,726 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#
# Copyright 2009 Martin Owens
#
# This program is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program.  If not, see <http://www.gnu.org/licenses/>
#
"""
Launchpad desktop integration libraries for GroundControl
"""

import os
import sys
import gettext
import locale

__stage__ = "DEV"
__appname__ = "groundcontrol"
__version__ = "1.6.6"

BASE_DIR = os.path.abspath( os.path.join(
    os.path.dirname(os.path.realpath(__file__)), '..') )

# This hack brought to you by the lucid build system
# That doesn't seem to want to run install_lib extras
if '/lib/' in BASE_DIR or '/pyshared' in BASE_DIR:
    __stage__ = "LIVE"
    BASE_DIR = '/usr/share/groundcontrol'
else:
    sys.stderr.write("%s %s: %s\n" % (__stage__, __version__, BASE_DIR))

GLADE_DIR  = os.path.join(BASE_DIR, 'glade')
PIXMAP_DIR = os.path.join(BASE_DIR, 'pixmaps')

if __stage__ == "LIVE":
    PO_DIR     = os.path.join(BASE_DIR, '../locale')
else:
    PO_DIR     = os.path.join(BASE_DIR, 'build/mo')

DOC_DIR    = os.path.join(BASE_DIR, 'doc')

# Globally deal with localization (l10n)
gettext.bindtextdomain(__appname__, PO_DIR)
locale.setlocale(locale.LC_ALL, '')
gettext.textdomain(__appname__)
gettext.install(__appname__)