/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: Szilveszter Farkas (Phanatic)
  • Date: 2007-01-29 23:56:33 UTC
  • mfrom: (134 trunk)
  • mto: (157.1.2 trunk) (170.1.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 136.
  • Revision ID: szilveszter.farkas@gmail.com-20070129235633-zxq4wy7a8o7xopko
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    return pygtk
38
38
 
39
39
 
 
40
def set_ui_factory():
 
41
    pygtk = import_pygtk()
 
42
    from olive.ui import GtkUIFactory
 
43
    import bzrlib.ui
 
44
    bzrlib.ui.ui_factory = GtkUIFactory()
 
45
 
 
46
 
40
47
class cmd_gbranch(Command):
41
48
    """GTK+ branching.
42
49
    
52
59
 
53
60
        from bzrlib.plugins.gtk.olive.branch import BranchDialog
54
61
 
 
62
        set_ui_factory()
55
63
        dialog = BranchDialog(os.path.abspath('.'))
56
64
        dialog.window.connect("destroy", lambda w: gtk.main_quit())
57
65
        dialog.display()
70
78
 
71
79
    @display_command
72
80
    def run(self, revision=None, filename=None):
 
81
        set_ui_factory()
73
82
        wt = WorkingTree.open_containing(".")[0]
74
83
        branch = wt.branch
75
84
        if revision is not None:
124
133
    aliases = [ "visualize", "vis", "viz" ]
125
134
 
126
135
    def run(self, location=".", revision=None, limit=None):
 
136
        set_ui_factory()
127
137
        (branch, path) = Branch.open_containing(location)
128
138
        branch.lock_read()
129
139
        branch.repository.lock_read()
171
181
        except RuntimeError, e:
172
182
            if str(e) == "could not open display":
173
183
                raise NoDisplayError
 
184
        set_ui_factory()
174
185
 
175
186
        try:
176
187
            line = int(line)
234
245
            if str(e) == "could not open display":
235
246
                raise NoDisplayError
236
247
 
 
248
        set_ui_factory()
237
249
        from olive.commit import CommitDialog
238
250
        from bzrlib.commit import Commit
239
251
        from bzrlib.errors import (BzrCommandError,
268
280
    """gtk could not find a proper display"""
269
281
 
270
282
    def __str__(self):
271
 
        return "No DISPLAY. gannotate is disabled."
 
283
        return "No DISPLAY. Unable to run GTK+ application."
 
284
 
 
285