/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: 2007-03-15 12:43:48 UTC
  • mto: (126.1.38 bzr-gtk)
  • mto: This revision was merged to the branch mainline in revision 172.
  • Revision ID: szilveszter.farkas@gmail.com-20070315124348-0nx0zb7fv4pa8xk6
Fix the indentation error in the TortoiseBZR test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
 
import sys
18
 
 
19
17
try:
20
18
    import pygtk
21
19
    pygtk.require("2.0")
24
22
 
25
23
import gtk
26
24
import gtk.glade
27
 
import gobject
28
 
import pango
29
25
 
30
26
import bzrlib.errors as errors
31
27
 
32
 
from olive import gladefile
 
28
from bzrlib.plugins.gtk.dialog import error_dialog
 
29
from guifiles import GLADEFILENAME
 
30
 
33
31
 
34
32
def info(location):
35
33
    """ Get info about branch, working tree, and repository
81
79
    try:
82
80
        a_bzrdir = bzrdir.BzrDir.open_containing(location)[0]
83
81
    except errors.NotBranchError:
84
 
        raise NotBranchError(location)
 
82
        raise errors.NotBranchError(location)
85
83
 
86
84
    try:
87
85
        working = a_bzrdir.open_workingtree()
144
142
 
145
143
class OliveInfo:
146
144
    """ Display Informations window and perform the needed actions. """
147
 
    def __init__(self, comm):
 
145
    def __init__(self, wt):
148
146
        """ Initialize the Informations window. """
149
 
        self.glade = gtk.glade.XML(gladefile, 'window_info', 'olive-gtk')
150
 
        
151
 
        # Communication object
152
 
        self.comm = comm
 
147
        self.glade = gtk.glade.XML(GLADEFILENAME, 'window_info', 'olive-gtk')
153
148
        
154
149
        # Get the Informations window widget
155
150
        self.window = self.glade.get_widget('window_info')
157
152
        # Check if current location is a branch
158
153
        self.notbranch = False
159
154
        try:
160
 
            self.ret = info(self.comm.get_path())
 
155
            self.ret = info(wt.basedir)
161
156
        except errors.NotBranchError:
162
157
            self.notbranch = True
163
158
            return
557
552
        """ Display the Informations window. """
558
553
        if self.notbranch:
559
554
            error_dialog(_('Directory is not a branch'),
560
 
                                     _('You can perform this action only in a branch.'))
 
555
                         _('You can perform this action only in a branch.'))
561
556
            self.close()
562
557
        else:
563
558
            self.window.show()