Merge branch 'master' of git+ssh://dev.laptop.org/git/sugar

This commit is contained in:
Marco Pesenti Gritti 2007-10-08 14:58:36 +02:00
commit f82e79e27c
2 changed files with 15 additions and 13 deletions

View File

@ -61,6 +61,7 @@ class MultiLogView(gtk.VBox):
self._configure_watcher() self._configure_watcher()
self._create_log_view() self._create_log_view()
def _configure_watcher(self): def _configure_watcher(self):
# Setting where gnomeVFS will be watching # Setting where gnomeVFS will be watching
gnomevfs.monitor_add('file://' + self._logs_path, gnomevfs.monitor_add('file://' + self._logs_path,
@ -93,7 +94,7 @@ class MultiLogView(gtk.VBox):
# Set buffer and scroll down # Set buffer and scroll down
self._view.textview.set_buffer(self._logs[act_log]) self._view.textview.set_buffer(self._logs[act_log])
self._view.textview.scroll_to_mark(self._logs[act_log].get_insert(), 0); self._view.textview.scroll_to_mark(self._logs[act_log].get_insert(), 0)
self._active_log = act_log self._active_log = act_log
def _create_log_view(self): def _create_log_view(self):
@ -176,18 +177,19 @@ class LogBuffer(gtk.TextBuffer):
self.update() self.update()
def update(self): def update(self):
f = open(self._logfile, 'r') try:
f = open(self._logfile, 'r')
init_pos = self._pos
init_pos = self._pos f.seek(self._pos)
self.insert(self.get_end_iter(), f.read())
self._pos = f.tell()
f.close()
f.seek(self._pos) self._written = (self._pos - init_pos)
self.insert(self.get_end_iter(), f.read()) except:
self._pos = f.tell() self.insert(self.get_end_iter(), "Console error: can't open the file\n")
self._written = 0
f.close()
self._written = (self._pos - init_pos)
return True
class LogView(gtk.ScrolledWindow): class LogView(gtk.ScrolledWindow):
def __init__(self): def __init__(self):

View File

@ -257,7 +257,7 @@ class Palette(gtk.Window):
def do_expose_event(self, event): def do_expose_event(self, event):
# We want to draw a border with a beautiful gap # We want to draw a border with a beautiful gap
if self._invoker.has_rectangle_gap(): if self._invoker is not None and self._invoker.has_rectangle_gap():
invoker = self._invoker.get_rect() invoker = self._invoker.get_rect()
palette = self.get_rect() palette = self.get_rect()