Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/ka_debug.py
diff options
context:
space:
mode:
authorNostalghia <b.vehikel@googlemail.com>2010-05-22 13:52:30 (GMT)
committer Nostalghia <b.vehikel@googlemail.com>2010-05-22 13:52:30 (GMT)
commite24ca571a8dccf66740d66e50b47862b5e28adc9 (patch)
treec65719efcd250439c45c96537f4e49654c51d145 /ka_debug.py
parent8394595622cbeb9894da9e83fd3dadacd6266cf6 (diff)
Bug fixing the mask modifier and border modifier in the rendering engine.
This is not backward compatible.
Diffstat (limited to 'ka_debug.py')
-rw-r--r--ka_debug.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/ka_debug.py b/ka_debug.py
index 9456259..03ed3f1 100644
--- a/ka_debug.py
+++ b/ka_debug.py
@@ -18,6 +18,7 @@
import logging
import os
import time
+import math
#Add support for design by contract to all classes except blacklist.
@@ -32,6 +33,7 @@ _try_once, locale_testrun = False, False
if os.path.exists(DEBUG_ACTIVITY_PATH):
locale_testrun = True
_try_once = True
+ _try_once = False
is_DbC_activated = False
@@ -54,6 +56,33 @@ def info(msg):
_logger.debug(msg)
# _logger.debug(caller())
+def _matrix(mtrx, context):
+ """Log an info message."""
+ xx, yx, xy, yy, x0, y0 = mtrx
+ det = xx * yy + yx * xy
+ if math.fabs(det) < (0.004 ** 2):
+ global _last_clock, locale_testrun
+ clock_now = time.clock()
+ if locale_testrun:
+ print 'matrix', int((time.time()-_start_time)*1000), \
+ int((clock_now-_last_clock)*1000), ':', context, mtrx, ', det=', det
+ _last_clock = clock_now
+ _avtivate_logger()
+ _logger.debug(mtrx)
+# raise ValueError('det=' + str(det) + ', ' + str(mtrx))
+
+def matrix(mtrx):
+ """Log an info message."""
+ _matrix(mtrx, '')
+
+def matrix_s(mtrx):
+ """Log matrix after save."""
+ _matrix(mtrx, 'save')
+
+def matrix_r(mtrx):
+ """Log matrix before restore."""
+ _matrix(mtrx, 'restore')
+
def err(msg):
"""Log an error message."""
global _last_clock, locale_testrun