[Pkg-privacy-commits] [pyptlib] 101/136: add a method to output debug data
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:25:15 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository pyptlib.
commit 7d20537ed9e0ff2cdb16b51f8ff6d0112e126007
Author: Ximin Luo <infinity0 at gmx.com>
Date: Tue Sep 10 15:59:02 2013 +0100
add a method to output debug data
---
pyptlib/config.py | 2 +-
pyptlib/core.py | 12 +++++++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/pyptlib/config.py b/pyptlib/config.py
index 4726763..77c826e 100644
--- a/pyptlib/config.py
+++ b/pyptlib/config.py
@@ -82,7 +82,7 @@ def get_env(key, validate=env_has_k):
try:
return validate(key, os.getenv(key))
except Exception, e:
- raise EnvError(cause=e)
+ raise EnvError("error parsing env-var: %s: %s" % (key, e), e)
class EnvError(Exception):
"""
diff --git a/pyptlib/core.py b/pyptlib/core.py
index 980095a..eba0cd5 100644
--- a/pyptlib/core.py
+++ b/pyptlib/core.py
@@ -108,11 +108,21 @@ class TransportPlugin(object):
def reportMethodsEnd(self):
"""
- Write a message to stdout announcing that we finished launching transports..
+ Write a message to stdout announcing that we finished launching transports.
"""
self.emit('%sS DONE' % self.methodName)
+ def getDebugData(self):
+ """
+ Return a dict containing internal data in arbitrary format, for debugging.
+ The data should only be presented and not processed further.
+ """
+ d = dict(self.__dict__)
+ d["config"] = dict(self.config.__dict__)
+ d["__class__"] = self.__class__
+ return d
+
def emit(self, msg):
"""
Announce a message.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/pyptlib.git
More information about the Pkg-privacy-commits
mailing list