summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Rohdewald <wolfgang@rohdewald.de>2015-11-27 07:16:30 (GMT)
committerWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-24 11:47:05 (GMT)
commit3cba7cd7077373238c42054868a5a0dae2ace109 (patch)
tree331881979bf677c967893ce2d9cbf44b88181669
parent22a7d0266b1e65b23c88f1d6ce766edac8d2e8fa (diff)
callers: exclude more methods from callstack, reverse display order
-rw-r--r--src/util.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/util.py b/src/util.py
index bff8fc8..5f95057 100644
--- a/src/util.py
+++ b/src/util.py
@@ -61,9 +61,16 @@ def callers(count=1, exclude=None):
stck = traceback.extract_stack(limit=30)
excluding = list(exclude) or []
excluding.extend(['<genexpr>', '__call__', 'run', '<module>', 'runTests'])
- names = list(x[2] for x in stck[:-2] if x[2] not in excluding)
+ excluding.extend(['_startRunCallbacks', '_runCallbacks', 'remote_move', 'exec_move'])
+ excluding.extend(['proto_message', '_recvMessage', 'remoteMessageReceived'])
+ excluding.extend(['clientAction', 'myAction', 'expressionReceived'])
+ excluding.extend(['callbackIfDone', 'callback', '__gotAnswer'])
+ excluding.extend(['callExpressionReceived', 'proto_answer'])
+ excluding.extend(['_dataReceived', 'dataReceived', 'gotItem'])
+ excluding.extend(['callWithContext', '_doReadOrWrite', 'doRead'])
+ names = list(reversed([x[2] for x in stck[:-2] if x[2] not in excluding]))
result = '.'.join(names[-count - 2:])
- return result
+ return '[{}]'.format(result)
def elapsedSince(since):