/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: David Planella
  • Date: 2011-03-06 08:24:07 UTC
  • mfrom: (718 trunk)
  • mto: This revision was merged to the branch mainline in revision 719.
  • Revision ID: david.planella@ubuntu.com-20110306082407-y9zwkjje5oue9egw
Added preliminary internationalization support. Merged from trunk.

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": [],
132
121
    "gmissing": [],
133
122
    "gpreferences": [],
134
123
    "gpush": [],
135
 
    "gselftest": [],
136
124
    "gsend": [],
137
125
    "gstatus": ["gst"],
138
126
    "gtags": [],
158
146
                                       save_commit_messages,
159
147
                                       "Saving commit messages for gcommit")
160
148
 
161
 
class NoDisplayError(errors.BzrCommandError):
162
 
    """gtk could not find a proper display"""
163
 
 
164
 
    def __str__(self):
165
 
        return "No DISPLAY. Unable to run GTK+ application."
166
 
 
167
 
 
168
149
credential_store_registry = getattr(config, "credential_store_registry", None)
169
150
if credential_store_registry is not None:
170
151
    try: