summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Rohdewald <wolfgang@rohdewald.de>2015-11-30 19:47:56 (GMT)
committerWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-25 06:41:38 (GMT)
commite8db54fb2405b3ed343c3b7c039f4483c17431a5 (patch)
treee7d54be2d07b1d3ef35bb9b58dc81645271c4686
parentc09b03ee146fa6aa829b9339aef2e53df4f1c5b7 (diff)
simplifiy usage of util.callers()
-rw-r--r--src/hand.py4
-rw-r--r--src/util.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/hand.py b/src/hand.py
index b307f0b..9ad7480 100644
--- a/src/hand.py
+++ b/src/hand.py
@@ -119,7 +119,7 @@ class Hand(object):
if Debug.hand or Debug.mahJongg:
self.debug(fmt('{callers}',
- callers=callers(10, exclude=['__init__'])))
+ callers=callers(exclude=['__init__'])))
Hand.indent += 1
_hideString = string
self.debug(fmt('New Hand {_hideString} {self.lenOffset}'))
@@ -569,7 +569,7 @@ class Hand(object):
result = sorted(matchingMJRules, key=lambda x: -x.score.total())
if Debug.mahJongg:
self.debug(fmt('{callers} Found {matchingMJRules}',
- callers=callers(5, exclude=[])))
+ callers=callers()))
return result
def __arrangements(self):
diff --git a/src/util.py b/src/util.py
index 224be77..a3a6e5c 100644
--- a/src/util.py
+++ b/src/util.py
@@ -56,10 +56,10 @@ def stack(msg, limit=6):
return result
-def callers(count=1, exclude=None):
+def callers(count=5, exclude=None):
"""returns the name of the calling method"""
stck = traceback.extract_stack(limit=30)
- excluding = list(exclude) or []
+ excluding = list(exclude) if exclude else []
excluding.extend(['<genexpr>', '__call__', 'run', '<module>', 'runTests'])
excluding.extend(['_startRunCallbacks', '_runCallbacks', 'remote_move', 'exec_move'])
excluding.extend(['proto_message', '_recvMessage', 'remoteMessageReceived'])