summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
Diffstat (limited to 'portato')
-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: