/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 __init__.py

  • Committer: Curtis Hovey
  • Date: 2011-07-31 16:50:29 UTC
  • mto: This revision was merged to the branch mainline in revision 741.
  • Revision ID: sinzui.is@verizon.net-20110731165029-9gixuqypi3lwapzm
Removed import_pygtk because gi does not impicitly call Main(). Inlined checks for gtk availablility.

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
    from bzrlib.trace import warning
76
76
    warning("Not running as bzrlib.plugins.gtk, things may break.")
77
77
 
78
 
def import_pygtk():
79
 
    try:
80
 
        import pygtk
81
 
    except ImportError:
82
 
        raise errors.BzrCommandError("PyGTK not installed.")
83
 
    pygtk.require('2.0')
84
 
    return pygtk
85
 
 
86
78
 
87
79
def set_ui_factory():
88
 
    import_pygtk()
89
80
    from ui import GtkUIFactory
90
81
    import bzrlib.ui
91
82
    bzrlib.ui.ui_factory = GtkUIFactory()
168
159
    try:
169
160
        result = basic_tests
170
161
        try:
171
 
            import_pygtk()
172
 
        except errors.BzrCommandError:
 
162
            import gi.repository.Gtk
 
163
        except ImportError:
173
164
            return basic_tests
174
165
        basic_tests.addTest(loader.loadTestsFromModuleNames(
175
166
                ["%s.%s" % (__name__, tmn) for tmn in testmod_names]))