/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/status.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)
31
 
 
32
 
import bzrlib
33
 
import bzrlib.errors as errors
34
 
 
35
 
from bzrlib.status import show_tree_status
36
 
from bzrlib.workingtree import WorkingTree
37
 
 
38
 
from dialog import OliveDialog
 
22
 
 
23
import gtk
 
24
import gtk.glade
 
25
 
 
26
from olive import gladefile
39
27
 
40
28
class OliveStatus:
41
29
    """ Display Status window and perform the needed actions. """
42
 
    def __init__(self, gladefile, wt, wtpath):
 
30
    def __init__(self, wt, wtpath):
43
31
        """ Initialize the Status window. """
44
 
        self.gladefile = gladefile
45
 
        self.glade = gtk.glade.XML(self.gladefile, 'window_status')
 
32
        self.glade = gtk.glade.XML(gladefile, 'window_status')
46
33
        
47
34
        # Get the Status window widget
48
35
        self.window = self.glade.get_widget('window_status')
 
36
        
49
37
        self.wt = wt
50
38
        self.wtpath = wtpath
51
39
        
52
40
        # Check if current location is a branch
53
 
        try:
54
 
            branch = wt.branch
55
 
        except errors.NotBranchError:
56
 
            self.notbranch = True
57
 
            return
58
 
        except:
59
 
            raise
60
 
        
61
41
        file_id = self.wt.path2id(wtpath)
62
42
 
63
 
        self.notbranch = False
64
 
        if file_id is None:
65
 
            self.notbranch = True
66
 
            return
67
 
        
68
43
        # Set the old working tree
69
44
        self.old_tree = self.wt.branch.repository.revision_tree(self.wt.branch.last_revision())
70
45
        
134
109
    
135
110
    def display(self):
136
111
        """ Display the Diff window. """
137
 
        if self.notbranch:
138
 
            error_dialog(_('Directory is not a branch'),
139
 
                                     _('You can perform this action only in a branch.'))
140
 
            self.close()
141
 
        else:
142
 
            self.window.show_all()
 
112
        self.window.show_all()
143
113
 
144
114
    def close(self, widget=None):
145
115
        self.window.destroy()