/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: Jelmer Vernooij
  • Date: 2008-03-09 13:47:52 UTC
  • mto: This revision was merged to the branch mainline in revision 447.
  • Revision ID: jelmer@samba.org-20080309134752-syf9kwzy6e919jhj
Add note about python-nautilus requiring a libpythonXX.so symlink.

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 bzrlib.plugins.gtk.dialog import error_dialog
 
29
from guifiles import GLADEFILENAME
 
30
 
 
31
 
34
32
def info(location):
35
33
    """ Get info about branch, working tree, and repository
36
34
    
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()
110
108
 
111
109
    try:
112
110
        branch = a_bzrdir.open_branch()
 
111
        repository = branch.repository
 
112
        control = a_bzrdir
113
113
        branch.lock_read()
114
114
        try:
115
115
            ret['location'] = info_helper.get_location_info(repository, branch)
144
144
 
145
145
class OliveInfo:
146
146
    """ Display Informations window and perform the needed actions. """
147
 
    def __init__(self, gladefile, comm, dialog):
 
147
    def __init__(self, branch):
148
148
        """ 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
 
149
        self.glade = gtk.glade.XML(GLADEFILENAME, 'window_info', 'olive-gtk')
156
150
        
157
151
        # Get the Informations window widget
158
152
        self.window = self.glade.get_widget('window_info')
160
154
        # Check if current location is a branch
161
155
        self.notbranch = False
162
156
        try:
163
 
            self.ret = info(self.comm.get_path())
 
157
            self.ret = info(branch.base)
164
158
        except errors.NotBranchError:
165
159
            self.notbranch = True
166
160
            return
559
553
    def display(self):
560
554
        """ Display the Informations window. """
561
555
        if self.notbranch:
562
 
            self.dialog.error_dialog(_('Directory is not a branch'),
563
 
                                     _('You can perform this action only in a branch.'))
 
556
            error_dialog(_('Directory is not a branch'),
 
557
                         _('You can perform this action only in a branch.'))
564
558
            self.close()
565
559
        else:
566
560
            self.window.show()