/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 commands.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:
32
32
from bzrlib.option import Option
33
33
 
34
34
from bzrlib.plugins.gtk import (
35
 
    import_pygtk,
36
35
    set_ui_factory,
37
36
    )
38
37
from bzrlib.plugins.gtk.i18n import _i18n
46
45
 
47
46
 
48
47
def open_display():
49
 
    pygtk = import_pygtk()
50
48
    try:
51
49
        from gi.repository import Gtk
52
50
    except RuntimeError, e:
53
51
        if str(e) == "could not open display":
54
52
            raise NoDisplayError
55
53
    set_ui_factory()
56
 
    return gtk
 
54
    return Gtk
57
55
 
58
56
 
59
57
 
236
234
    aliases = ["gblame", "gpraise"]
237
235
    
238
236
    def run(self, filename, all=False, plain=False, line='1', revision=None):
239
 
        gtk = open_display()
 
237
        Gtk = open_display()
240
238
 
241
239
        try:
242
240
            line = int(line)
331
329
    takes_options = ['revision']
332
330
 
333
331
    def run(self, path='.', revision=None):
334
 
        gtk = open_display()
 
332
        Gtk = open_display()
335
333
        from bzrlib.plugins.gtk.status import StatusWindow
336
334
        (wt, wt_path) = workingtree.WorkingTree.open_containing(path)
337
335
 
357
355
    """
358
356
    def run(self):
359
357
        (br, path) = branch.Branch.open_containing(".")
360
 
        gtk = open_display()
 
358
        Gtk = open_display()
361
359
        from bzrlib.plugins.gtk.mergedirective import SendMergeDirectiveDialog
362
360
        from StringIO import StringIO
363
361
        dialog = SendMergeDirectiveDialog(br)
424
422
    """
425
423
    takes_args = ["other_branch?"]
426
424
    def run(self, other_branch=None):
427
 
        pygtk = import_pygtk()
428
425
        try:
429
426
            from gi.repository import Gtk
430
427
        except RuntimeError, e:
476
473
    def run(self):
477
474
        br = branch.Branch.open_containing('.')[0]
478
475
        
479
 
        gtk = open_display()
 
476
        Gtk = open_display()
480
477
        from tags import TagsWindow
481
478
        window = TagsWindow(br)
482
479
        window.show()