/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: 2006-09-30 10:21:43 UTC
  • Revision ID: jelmer@samba.org-20060930102143-c0ef64d6ca860c21
Merge some files from Olive and bzr-gtk.

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
 
17
19
try:
18
20
    import pygtk
19
21
    pygtk.require("2.0")
22
24
 
23
25
import gtk
24
26
import gtk.glade
 
27
import gobject
 
28
import pango
25
29
 
26
30
import bzrlib.errors as errors
27
31
 
28
 
from bzrlib.plugins.gtk.dialog import error_dialog
29
 
from guifiles import GLADEFILENAME
30
 
 
 
32
from olive import gladefile
31
33
 
32
34
def info(location):
33
35
    """ Get info about branch, working tree, and repository
79
81
    try:
80
82
        a_bzrdir = bzrdir.BzrDir.open_containing(location)[0]
81
83
    except errors.NotBranchError:
82
 
        raise errors.NotBranchError(location)
 
84
        raise NotBranchError(location)
83
85
 
84
86
    try:
85
87
        working = a_bzrdir.open_workingtree()
108
110
 
109
111
    try:
110
112
        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, branch):
 
147
    def __init__(self, wt):
148
148
        """ Initialize the Informations window. """
149
 
        self.glade = gtk.glade.XML(GLADEFILENAME, 'window_info', 'olive-gtk')
 
149
        self.glade = gtk.glade.XML(gladefile, 'window_info', 'olive-gtk')
150
150
        
151
151
        # Get the Informations window widget
152
152
        self.window = self.glade.get_widget('window_info')
154
154
        # Check if current location is a branch
155
155
        self.notbranch = False
156
156
        try:
157
 
            self.ret = info(branch.base)
 
157
            self.ret = info(wt.basedir)
158
158
        except errors.NotBranchError:
159
159
            self.notbranch = True
160
160
            return
554
554
        """ Display the Informations window. """
555
555
        if self.notbranch:
556
556
            error_dialog(_('Directory is not a branch'),
557
 
                         _('You can perform this action only in a branch.'))
 
557
                                     _('You can perform this action only in a branch.'))
558
558
            self.close()
559
559
        else:
560
560
            self.window.show()