diff options
author | necoro <> | 2007-07-13 04:09:51 +0000 |
---|---|---|
committer | necoro <> | 2007-07-13 04:09:51 +0000 |
commit | fc6d232a9357211a44dad3300ff64571620aa1bf (patch) | |
tree | 2f31112805b8d05c94978775a183668dc260367c /portato/gui | |
parent | b5e8e2eb2b8bc9936070028ecf91ff8d0b7c33ef (diff) | |
download | portato-fc6d232a9357211a44dad3300ff64571620aa1bf.tar.gz portato-fc6d232a9357211a44dad3300ff64571620aa1bf.tar.bz2 portato-fc6d232a9357211a44dad3300ff64571620aa1bf.zip |
new fancier log output
Diffstat (limited to '')
-rw-r--r-- | portato/gui/gtk/windows.py | 11 | ||||
-rw-r--r-- | portato/gui/gui_helper.py | 20 | ||||
-rw-r--r-- | portato/gui/qt/terminal.py | 7 | ||||
-rw-r--r-- | portato/gui/qt/windows.py | 10 |
4 files changed, 26 insertions, 22 deletions
diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py index 6eacd34..ac87b01 100644 --- a/portato/gui/gtk/windows.py +++ b/portato/gui/gtk/windows.py @@ -609,7 +609,6 @@ class PackageTable: combo.set_active(i) break except AttributeError: # no package found -# debug('catched AttributeError => no "best package" found. Selected first one.') combo.set_active(0) combo.connect("changed", self.cb_combo_changed) @@ -638,7 +637,7 @@ class PackageTable: try: self.queue.append(self.actual_package().get_cpv(), unmerge = True) except PackageNotFoundException, e: - debug("Package could not be found",e[0], error = 1) + error("Package could not be found: %s", e[0]) #masked_dialog(e[0]) def cb_combo_changed (self, combo): @@ -1105,9 +1104,9 @@ class MainWindow (Window): flags.write_use_flags() if len(flags.new_masked)>0 or len(flags.new_unmasked)>0 or len(flags.newTesting)>0: - debug("new masked:",flags.new_masked) - debug("new unmasked:", flags.new_unmasked) - debug("new testing:", flags.newTesting) + debug("new masked: %s",flags.new_masked) + debug("new unmasked: %s", flags.new_unmasked) + debug("new testing: %s", flags.newTesting) changed_flags_dialog("masking keywords") flags.write_masked() flags.write_testing() @@ -1134,7 +1133,7 @@ class MainWindow (Window): else: updating = system.update_world(newuse = self.cfg.get_boolean("newuse"), deep = self.cfg.get_boolean("deep")) - debug("updating list:", [(x.get_cpv(), y.get_cpv()) for x,y in updating],"--> length:",len(updating)) + debug("updating list: %s --> length: %s", [(x.get_cpv(), y.get_cpv()) for x,y in updating], len(updating)) try: try: for pkg, old_pkg in updating: diff --git a/portato/gui/gui_helper.py b/portato/gui/gui_helper.py index 8ee858f..f9dd3fe 100644 --- a/portato/gui/gui_helper.py +++ b/portato/gui/gui_helper.py @@ -29,6 +29,7 @@ import pty import time import os import signal +import logging class Config: """Wrapper around a ConfigParser and for additional local configurations.""" @@ -103,9 +104,12 @@ class Config: flags.set_config(flagCfg) def modify_debug_config (self): - """Sets the external debug-config. - @see: L{helper.set_debug()}""" - set_debug(self.get_boolean("debug")) + if self.get_boolean("debug"): + level = logging.DEBUG + else: + level = logging.INFO + + set_log_level(level) def modify_system_config (self): """Sets the system config. @@ -232,7 +236,7 @@ class Database: return inst+ninst except KeyError: # cat is in category list - but not in portage - debug("Catched KeyError =>", cat, "seems not to be an available category. Have you played with rsync-excludes?") + info("Catched KeyError => %s seems not to be an available category. Have you played with rsync-excludes?", cat) return [] def reload (self, cat): @@ -378,7 +382,7 @@ class EmergeQueue: try: self.update_tree(subIt, d, unmask) except backend.BlockedException, e: # BlockedException occured -> delete current tree and re-raise exception - debug("Something blocked:", e[0]) + debug("Something blocked: %s", e[0]) self.remove_with_children(subIt) raise @@ -470,7 +474,7 @@ class EmergeQueue: if p in ["world", "system"]: continue cat = system.split_cpv(p)[0] # get category self.db.reload(cat) - debug("Category %s refreshed" % cat) + debug("Category %s refreshed", cat) update_packages() self.process = None @@ -687,14 +691,14 @@ class EmergeQueue: try: del self.deps[cpv] except KeyError: # this seems to be removed due to a BlockedException - so no deps here atm ;) - debug("Catched KeyError =>", cpv, "seems not to be in self.deps. Should be no harm in normal cases.") + debug("Catched KeyError => %s seems not to be in self.deps. Should be no harm in normal cases.", cpv) try: self.mergequeue.remove(cpv) except ValueError: # this is a dependency - ignore try: self.oneshotmerge.remove(cpv) except ValueError: - debug("Catched ValueError =>", cpv, "seems not to be in merge-queue. Should be no harm.") + debug("Catched ValueError => %s seems not to be in merge-queue. Should be no harm.", cpv) if removeNewFlags: # remove the changed flags flags.remove_new_use_flags(cpv) diff --git a/portato/gui/qt/terminal.py b/portato/gui/qt/terminal.py index 0c7cf8b..a70e56b 100644 --- a/portato/gui/qt/terminal.py +++ b/portato/gui/qt/terminal.py @@ -17,16 +17,17 @@ from threading import Thread, currentThread from os import read, close import errno +from portato.gui.wrapper import Console +from portato.helper import debug + try: from curses.ascii import ctrl except ImportError: # emulate ctrl-behavior for known values def ctrl (val): if val == "H": return '\x08' elif val == "W": return '\x17' - else: debug("unknown error passed to emulated ctrl:",val) + else: debug("unknown error passed to emulated ctrl: %s",val) -from portato.gui.wrapper import Console -from portato.helper import debug class WriteEvent (Qt.QEvent): TYPE = Qt.QEvent.Type(1001) diff --git a/portato/gui/qt/windows.py b/portato/gui/qt/windows.py index a61a6d7..2f40dcf 100644 --- a/portato/gui/qt/windows.py +++ b/portato/gui/qt/windows.py @@ -497,7 +497,7 @@ class PackageDetails: try: self.queue.append(self.actual_package().get_cpv(), unmerge = True) except PackageNotFoundException, e: - debug("Package could not be found",e[0], error = 1) + error("Package could not be found: %s", e[0]) def actual_package (self): @@ -971,9 +971,9 @@ class MainWindow (Window): flags.write_use_flags() if len(flags.new_masked)>0 or len(flags.new_unmasked)>0 or len(flags.newTesting)>0: - debug("new masked:",flags.new_masked) - debug("new unmasked:", flags.new_unmasked) - debug("new testing:", flags.newTesting) + debug("new masked: %s",flags.new_masked) + debug("new unmasked: %s", flags.new_unmasked) + debug("new testing: %s", flags.newTesting) changed_flags_dialog(self, "masking keywords") flags.write_masked() flags.write_testing() @@ -1001,7 +1001,7 @@ class MainWindow (Window): else: updating = system.update_world(newuse = self.cfg.get_boolean("newuse"), deep = self.cfg.get_boolean("deep")) - debug("updating list:", [(x.get_cpv(), y.get_cpv()) for x,y in updating],"--> length:",len(updating)) + debug("updating list: %s --> length: %s", [(x.get_cpv(), y.get_cpv()) for x,y in updating], len(updating)) try: try: for pkg, old_pkg in updating: |