server/sources/__init__.py
changeset 9402 2c48c091b6a2
parent 9292 4b3e657d17ab
child 9445 65d93a4fd11c
child 9492 c7fc56eecd1a
--- a/server/sources/__init__.py	Tue Jul 02 17:09:04 2013 +0200
+++ b/server/sources/__init__.py	Mon Jan 13 13:47:47 2014 +0100
@@ -21,6 +21,7 @@
 
 import itertools
 from os.path import join, splitext
+from time import time
 from datetime import datetime, timedelta
 from logging import getLogger
 
@@ -37,7 +38,9 @@
 
 def dbg_st_search(uri, union, varmap, args, cachekey=None, prefix='rql for'):
     if server.DEBUG & server.DBG_RQL:
+        global t
         print '  %s %s source: %s' % (prefix, uri, repr(union.as_string()))
+        t = time()
         if varmap:
             print '    using varmap', varmap
         if server.DEBUG & server.DBG_MORE:
@@ -51,9 +54,10 @@
 def dbg_results(results):
     if server.DEBUG & server.DBG_RQL:
         if len(results) > 10:
-            print '  -->', results[:10], '...', len(results)
+            print '  -->', results[:10], '...', len(results),
         else:
-            print '  -->', results
+            print '  -->', results,
+        print 'time: ', time() - t
     # return true so it can be used as assertion (and so be killed by python -O)
     return True
 
@@ -179,7 +183,7 @@
             elif value is not None:
                 # type check
                 try:
-                    value = configuration.convert(value, optdict, optname)
+                    value = configuration._validate(value, optdict, optname)
                 except Exception as ex:
                     msg = unicode(ex) # XXX internationalization
                     raise ValidationError(eid, {role_name('config', 'subject'): msg})