/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-gtk

  • Committer: Jelmer Vernooij
  • Date: 2007-07-13 23:09:47 UTC
  • Revision ID: jelmer@samba.org-20070713230947-0bngzxibg52vhmjo
Move olive about dialog into olive.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
                os.execvp(python, [python] + sys.argv)
38
38
            except OSError:
39
39
                pass
40
 
    print >>sys.stderr, _('bzr: error: cannot find a suitable python interpreter (need %d.%d or later)') % NEED_VERS
 
40
    print >>sys.stderr, ('bzr: error: cannot find a suitable python interpreter'
 
41
                         ' (need %d.%d or later)'
 
42
                        ) % NEED_VERS
41
43
    sys.exit(1)
42
44
 
43
45
try:
44
 
        import pygtk
45
 
        pygtk.require("2.0")
 
46
    import pygtk
 
47
    pygtk.require("2.0")
46
48
except:
47
 
        pass
 
49
    pass
 
50
 
48
51
try:
49
 
        import gtk
50
 
        import gtk.glade
 
52
    import gtk
 
53
    import gtk.glade
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 python-glade2 and/or 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
        for i in s.splitlines():
 
79
            if i.startswith("Using bzrlib: "):
 
80
                path = os.path.split(i[14:])[0]
 
81
                sys.path.append(path)
 
82
                break
 
83
        else:
 
84
            print >>sys.stderr, "Can't find bzrlib location"
 
85
            sys.exit(1)
 
86
 
 
87
from bzrlib.plugin import load_plugins
 
88
load_plugins()
 
89
 
 
90
import bzrlib.ui
 
91
import bzrlib.plugins.gtk.ui as ui
 
92
bzrlib.ui.ui_factory = ui.GtkUIFactory()
 
93
 
 
94
from olive import OliveGtk
61
95
app = OliveGtk()
62
96
gtk.main()