summaryrefslogtreecommitdiff
path: root/portato/gui
diff options
context:
space:
mode:
authorNecoro <>2008-01-25 10:22:45 +0000
committerNecoro <>2008-01-25 10:22:45 +0000
commit43bb555d0925f447a89b0e3559d63704e4bafea0 (patch)
treeb16aa6a018e9304a878492cf07e33e2aaafa300e /portato/gui
parentd46f2db937f04c6c366816273aaf0209f742a502 (diff)
downloadportato-43bb555d0925f447a89b0e3559d63704e4bafea0.tar.gz
portato-43bb555d0925f447a89b0e3559d63704e4bafea0.tar.bz2
portato-43bb555d0925f447a89b0e3559d63704e4bafea0.zip
r725@Devoty: necoro | 2008-01-25 11:21:07 +0100
small bug fixes
Diffstat (limited to 'portato/gui')
-rw-r--r--portato/gui/gtk/views.py5
-rw-r--r--portato/gui/updater.py10
2 files changed, 10 insertions, 5 deletions
diff --git a/portato/gui/gtk/views.py b/portato/gui/gtk/views.py
index 7c5af3d..db1f054 100644
--- a/portato/gui/gtk/views.py
+++ b/portato/gui/gtk/views.py
@@ -132,12 +132,11 @@ class LogView (logging.Handler):
logging.getLogger("portatoLogger").addHandler(self)
def emit (self, record):
- iter = self.buf.get_end_iter()
for lvl, name, color in self.colors:
if lvl == -1 or record.levelno <= lvl:
tag = "log_%s" % name
break
- self.buf.insert_with_tags_by_name(iter, "* ", tag)
- self.buf.insert_at_cursor(record.getMessage()+"\n")
+ self.buf.insert_with_tags_by_name(self.buf.get_end_iter(), "* ", tag)
+ self.buf.insert(self.buf.get_end_iter(), record.getMessage()+"\n")
diff --git a/portato/gui/updater.py b/portato/gui/updater.py
index f0d4c90..fb80118 100644
--- a/portato/gui/updater.py
+++ b/portato/gui/updater.py
@@ -15,7 +15,7 @@ from __future__ import absolute_import
from ..backend import system
import threading, subprocess, time
-from ..helper import debug
+from ..helper import debug, error
class Updater (object):
"""
@@ -85,7 +85,7 @@ q
This is done here.
"""
- pkgs = [l.get_cpv() for l in system.find_packages("=%s" % pv)]
+ pkgs = system.find_packages("=%s" % pv, only_cpv = True)
if len(pkgs) > 1: # ambigous - try to find the one which is also in the iterators
for p in pkgs:
@@ -93,6 +93,7 @@ q
return p
elif not pkgs: # nothing found =|
error(_("Trying to remove package '%s' from queue which does not exist in system."), pv)
+ return None
else: # only one choice =)
return pkgs[0]
@@ -100,6 +101,11 @@ q
"""
Remove a package from the queue.
"""
+
+ if cpv is None:
+ debug("Nothing to remove.")
+ return
+
try:
self.queue.remove(self.iterators[cpv])
except KeyError: