~ubuntu-branches/ubuntu/maverick/pitivi/maverick-updates

« back to all changes in this revision

Viewing changes to bin/pitivi.in

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2010-09-09 12:37:45 UTC
  • mfrom: (1.2.8 upstream) (3.1.17 experimental)
  • Revision ID: james.westby@ubuntu.com-20100909123745-dphljojkgwa54td9
Tags: 0.13.4.2-1ubuntu1
* Merge with Debian experimental, remaining Ubuntu changes:
* debian/control:
  - Add Vcs-Bzr link
  - Build-depend on python-launchpad-integration
  - Drop hal from Recommends to Suggests. This version has the patch applied
    to not crash without hal. Hal-B-gone from our CDs!
* debian/rules:
  - Use gnome.mk so a translation template is built
* debian/patches/01_lpi.patch:
  - launchpad integration

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
# variables
30
30
CONFIGURED_PYTHONPATH = '@CONFIGURED_PYTHONPATH@'
 
31
CONFIGURED_LD_LIBRARY_PATH = '@CONFIGURED_LD_LIBRARY_PATH@'
 
32
CONFIGURED_GST_PLUGIN_PATH = '@CONFIGURED_GST_PLUGIN_PATH@'
31
33
LIBDIR = '@LIBDIR@'
32
34
 
33
35
localedir = ""
34
36
 
 
37
# Check if we're in development or installed version
35
38
# Add the path of pitivi stuff
36
39
# TODO : change it when it's finally in cvs
37
40
 
38
41
def _get_root_dir():
39
42
    return '/'.join(os.path.dirname(os.path.abspath(__file__)).split('/')[:-1])
40
43
 
 
44
def _prepend_env_path(name, value):
 
45
    os.environ[name] = os.pathsep.join(value +
 
46
            os.environ.get(name, "").split(os.pathsep))
 
47
 
 
48
def jump_through_hoops():
 
49
    os.environ["JUMP_THROUGH_HOOPS"] = "1"
 
50
    os.execv(sys.argv[0], sys.argv)
 
51
 
41
52
def _add_pitivi_path():
42
53
    global localedir
43
54
    dir = os.path.dirname(os.path.abspath(__file__))
65
76
    except:
66
77
        print "Couldn't set locale !, reverting to C locale"
67
78
 
 
79
    if CONFIGURED_LD_LIBRARY_PATH or CONFIGURED_GST_PLUGIN_PATH:
 
80
        _prepend_env_path("LD_LIBRARY_PATH", [CONFIGURED_LD_LIBRARY_PATH])
 
81
        _prepend_env_path("GST_PLUGIN_PATH", [CONFIGURED_GST_PLUGIN_PATH])
 
82
 
 
83
        if "JUMP_THROUGH_HOOPS" not in os.environ:
 
84
            # ld caches LD_LIBRARY_PATH at startup so we need to execv() here. LALA.
 
85
            jump_through_hoops()
 
86
 
68
87
def _init_gobject_gtk_gst():
69
88
    global localedir
70
89
    try:
75
94
 
76
95
        import gobject
77
96
        gobject.threads_init()
78
 
    except ImportError:
79
 
        raise SystemExit("PyGTK couldn't be found !")
 
97
    except ImportError, e:
 
98
        raise SystemExit("PyGTK couldn't be found !", str(e))
80
99
 
81
100
    gobject.threads_init()
82
101
 
91
110
        import pygst
92
111
        pygst.require('0.10')
93
112
 
 
113
        args, sys.argv[:] = sys.argv[:], sys.argv[0:1]
94
114
        import gst
 
115
        sys.argv = args
95
116
    except ImportError:
96
117
        raise SystemExit("Gst-Python couldn't be found!")
97
118