/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: Jelmer Vernooij
  • Date: 2011-01-31 10:19:52 UTC
  • Revision ID: jelmer@samba.org-20110131101952-dkllorckboek3iqo
Move display opening, etc to commands.py.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
"""Graphical support for Bazaar using GTK.
16
16
 
17
17
This plugin includes:
18
 
gannotate         GTK+ annotate. 
19
 
gbranch           GTK+ branching. 
20
 
gcheckout         GTK+ checkout. 
 
18
gannotate         GTK+ annotate.
 
19
gbranch           GTK+ branching.
 
20
gcheckout         GTK+ checkout.
21
21
gcommit           GTK+ commit dialog.
22
 
gconflicts        GTK+ conflicts. 
23
 
gdiff             Show differences in working tree in a GTK+ Window. 
 
22
gconflicts        GTK+ conflicts.
 
23
gdiff             Show differences in working tree in a GTK+ Window.
24
24
ginit             Initialise a new branch.
25
25
gloom             GTK+ loom browse dialog
26
26
gmerge            GTK+ merge dialog
27
 
gmissing          GTK+ missing revisions dialog. 
28
 
gpreferences      GTK+ preferences dialog. 
 
27
gmissing          GTK+ missing revisions dialog.
 
28
gpreferences      GTK+ preferences dialog.
29
29
gpush             GTK+ push.
30
30
gsend             GTK+ send merge directive.
31
31
gstatus           GTK+ status dialog.
32
32
gtags             Manage branch tags.
33
 
visualise         Graphically visualise this branch. 
 
33
visualise         Graphically visualise this branch.
34
34
"""
35
35
 
36
36
import os
109
109
    return data_path(os.path.join('icons', *args))
110
110
 
111
111
 
112
 
def open_display():
113
 
    pygtk = import_pygtk()
114
 
    try:
115
 
        import gtk
116
 
    except RuntimeError, e:
117
 
        if str(e) == "could not open display":
118
 
            raise NoDisplayError
119
 
    set_ui_factory()
120
 
    return gtk
121
 
 
122
 
 
123
112
commands = {
124
113
    "gannotate": ["gblame", "gpraise"],
125
114
    "gbranch": [],
157
146
                                       save_commit_messages,
158
147
                                       "Saving commit messages for gcommit")
159
148
 
160
 
class NoDisplayError(errors.BzrCommandError):
161
 
    """gtk could not find a proper display"""
162
 
 
163
 
    def __str__(self):
164
 
        return "No DISPLAY. Unable to run GTK+ application."
165
 
 
166
 
 
167
149
credential_store_registry = getattr(config, "credential_store_registry", None)
168
150
if credential_store_registry is not None:
169
151
    try: