/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to olive/olive-gtk

  • Committer: Jelmer Vernooij
  • Date: 2010-05-25 17:09:02 UTC
  • mto: This revision was merged to the branch mainline in revision 691.
  • Revision ID: jelmer@samba.org-20100525170902-3to8g5iw7ovw79kh
Split out olive into a separate directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
 
1
#!/usr/bin/python
2
2
 
3
3
# Copyright (C) 2006 by Szilveszter Farkas (Phanatic) <szilveszter.farkas@gmail.com>
4
4
#
18
18
 
19
19
import os
20
20
import sys
 
21
import re
21
22
 
22
23
try:
23
24
    version_info = sys.version_info
37
38
                os.execvp(python, [python] + sys.argv)
38
39
            except OSError:
39
40
                pass
40
 
    print >>sys.stderr, _('bzr: error: cannot find a suitable python interpreter (need %d.%d or later)') % NEED_VERS
 
41
    print >>sys.stderr, ('bzr: error: cannot find a suitable python interpreter'
 
42
                         ' (need %d.%d or later)'
 
43
                        ) % NEED_VERS
41
44
    sys.exit(1)
42
45
 
43
46
try:
44
 
        import pygtk
45
 
        pygtk.require("2.0")
 
47
    import pygtk
 
48
    pygtk.require("2.0")
46
49
except:
47
 
        pass
 
50
    pass
 
51
 
48
52
try:
49
 
        import gtk
50
 
        import gtk.glade
 
53
    import gtk
51
54
except:
52
 
    print >>sys.stderr, _('You need to install python-glade2 and/or pygtk2 (gtk2) or set your PYTHONPATH correctly.\ntry: export PYTHONPATH=/usr/local/lib/python2.4/site-packages/')
 
55
    print >>sys.stderr, ('You need to install pygtk2 (gtk2)'
 
56
                         ' or set your PYTHONPATH correctly.\n'
 
57
                         'try: export PYTHONPATH=/usr/local/lib/python2.4/site-packages/'
 
58
                        )
53
59
    sys.exit(1)
54
60
 
55
61
# gettext support
56
62
import gettext
57
63
gettext.install('olive-gtk')
58
64
 
59
 
from olive.frontend.gtk import OliveGtk
60
 
 
 
65
 
 
66
# make sure we could import bzrlib
 
67
try:
 
68
    import bzrlib
 
69
except ImportError:
 
70
    # try to find bzr if it exist in $PATH
 
71
    p = os.popen('bzr version')
 
72
    s = p.read()
 
73
    r = p.close()
 
74
    if r not in (None, 0):
 
75
        print >>sys.stderr, "bzr not found"
 
76
        sys.exit(1)
 
77
    else:
 
78
        bzrlib_match = re.compile(r"bzrlib: (.*)[/\\]bzrlib").search(s)
 
79
        if bzrlib_match:
 
80
            sys.path.append(bzrlib_match.group(1))
 
81
        else:
 
82
            print >>sys.stderr, "Can't find bzrlib location"
 
83
            sys.exit(1)
 
84
 
 
85
from bzrlib.plugin import load_plugins
 
86
load_plugins()
 
87
 
 
88
import bzrlib.ui
 
89
import bzrlib.plugins.gtk.ui as ui
 
90
bzrlib.ui.ui_factory = ui.GtkUIFactory()
 
91
 
 
92
from bzrlib.plugins.gtk.olive import OliveGtk
61
93
app = OliveGtk()
62
94
gtk.main()