[kupfer] plugin.core: Add qfurl to DebugInfo



commit 4238547c730319393021ef20ac78958596db6b6c
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Thu Sep 10 02:52:24 2009 +0200

    plugin.core: Add qfurl to DebugInfo

 kupfer/plugin/core.py |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/plugin/core.py b/kupfer/plugin/core.py
index 0b719f2..f566c1d 100644
--- a/kupfer/plugin/core.py
+++ b/kupfer/plugin/core.py
@@ -76,9 +76,15 @@ class DebugInfo (Action, pretty.OutputMixin):
 
 	def activate(self, leaf):
 		import itertools
+		from kupfer import qfurl
 		print_func = lambda *args : pretty.print_debug("debug", *args)
 		print_func("Debug info about", leaf)
 		print_func(leaf, repr(leaf))
+		def get_qfurl(leaf):
+			try:
+				return qfurl.qfurl(leaf)
+			except qfurl.QfurlError:
+				pass
 		def get_object_fields(leaf):
 			return {
 				"repr" : leaf,
@@ -90,6 +96,7 @@ class DebugInfo (Action, pretty.OutputMixin):
 				"type" : type(leaf),
 				"module" : leaf.__module__,
 				"aliases" : getattr(leaf, "name_aliases", None),
+				"qfurl" : get_qfurl(leaf),
 				}
 		def get_leaf_fields(leaf):
 			base = get_object_fields(leaf)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]