/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 olive/info.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2006-09-30 13:04:15 UTC
  • mto: (0.14.3 main)
  • mto: This revision was merged to the branch mainline in revision 86.
  • Revision ID: Szilveszter.Farkas@gmail.com-20060930130415-aba4100709e11f0a
Loads of fixes. Pyflakes cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
import bzrlib.errors as errors
27
27
 
28
 
from bzrlib.plugins.gtk import _i18n
29
 
from bzrlib.plugins.gtk.dialog import error_dialog
30
 
from guifiles import GLADEFILENAME
31
 
 
 
28
from olive import gladefile
 
29
from dialog import error_dialog
32
30
 
33
31
def info(location):
34
32
    """ Get info about branch, working tree, and repository
109
107
 
110
108
    try:
111
109
        branch = a_bzrdir.open_branch()
112
 
        repository = branch.repository
113
 
        control = a_bzrdir
114
110
        branch.lock_read()
115
111
        try:
116
112
            ret['location'] = info_helper.get_location_info(repository, branch)
145
141
 
146
142
class OliveInfo:
147
143
    """ Display Informations window and perform the needed actions. """
148
 
    def __init__(self, branch):
 
144
    def __init__(self, wt):
149
145
        """ Initialize the Informations window. """
150
 
        self.glade = gtk.glade.XML(GLADEFILENAME, 'window_info', 'olive-gtk')
 
146
        self.glade = gtk.glade.XML(gladefile, 'window_info', 'olive-gtk')
151
147
        
152
148
        # Get the Informations window widget
153
149
        self.window = self.glade.get_widget('window_info')
155
151
        # Check if current location is a branch
156
152
        self.notbranch = False
157
153
        try:
158
 
            self.ret = info(branch.base)
 
154
            self.ret = info(wt.basedir)
159
155
        except errors.NotBranchError:
160
156
            self.notbranch = True
161
157
            return
554
550
    def display(self):
555
551
        """ Display the Informations window. """
556
552
        if self.notbranch:
557
 
            error_dialog(_i18n('Directory is not a branch'),
558
 
                         _i18n('You can perform this action only in a branch.'))
 
553
            error_dialog(_('Directory is not a branch'),
 
554
                         _('You can perform this action only in a branch.'))
559
555
            self.close()
560
556
        else:
561
557
            self.window.show()