/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:
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")
22
20
except:
23
21
    pass
24
 
try:
25
 
    import gtk
26
 
    import gtk.glade
27
 
    import gobject
28
 
    import pango
29
 
except:
30
 
    sys.exit(1)
 
22
 
 
23
import gtk
 
24
import gtk.glade
31
25
 
32
26
import bzrlib.errors as errors
33
27
 
 
28
from olive import gladefile
 
29
from dialog import error_dialog
 
30
 
34
31
def info(location):
35
32
    """ Get info about branch, working tree, and repository
36
33
    
81
78
    try:
82
79
        a_bzrdir = bzrdir.BzrDir.open_containing(location)[0]
83
80
    except errors.NotBranchError:
84
 
        raise NotBranchError(location)
 
81
        raise errors.NotBranchError(location)
85
82
 
86
83
    try:
87
84
        working = a_bzrdir.open_workingtree()
144
141
 
145
142
class OliveInfo:
146
143
    """ Display Informations window and perform the needed actions. """
147
 
    def __init__(self, gladefile, comm, dialog):
 
144
    def __init__(self, wt):
148
145
        """ Initialize the Informations window. """
149
 
        self.gladefile = gladefile
150
 
        self.glade = gtk.glade.XML(self.gladefile, 'window_info', 'olive-gtk')
151
 
        
152
 
        # Communication object
153
 
        self.comm = comm
154
 
        # Dialog object
155
 
        self.dialog = dialog
 
146
        self.glade = gtk.glade.XML(gladefile, 'window_info', 'olive-gtk')
156
147
        
157
148
        # Get the Informations window widget
158
149
        self.window = self.glade.get_widget('window_info')
160
151
        # Check if current location is a branch
161
152
        self.notbranch = False
162
153
        try:
163
 
            self.ret = info(self.comm.get_path())
 
154
            self.ret = info(wt.basedir)
164
155
        except errors.NotBranchError:
165
156
            self.notbranch = True
166
157
            return
559
550
    def display(self):
560
551
        """ Display the Informations window. """
561
552
        if self.notbranch:
562
 
            self.dialog.error_dialog(_('Directory is not a branch'),
563
 
                                     _('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.'))
564
555
            self.close()
565
556
        else:
566
557
            self.window.show()