25 |
25 |
26 from yams.schema import role_name |
26 from yams.schema import role_name |
27 |
27 |
28 from cubicweb import ValidationError, set_log_methods, server, _ |
28 from cubicweb import ValidationError, set_log_methods, server, _ |
29 from cubicweb.server import SOURCE_TYPES |
29 from cubicweb.server import SOURCE_TYPES |
|
30 from cubicweb.misc.source_highlight import highlight |
30 |
31 |
31 |
32 |
32 def dbg_st_search(uri, union, args, cachekey=None, prefix='rql for'): |
33 def dbg_st_search(uri, union, args, cachekey=None, prefix='rql for'): |
33 if server.DEBUG & server.DBG_RQL: |
34 if server.DEBUG & server.DBG_RQL: |
34 global t |
35 global t |
35 print(' %s %s source: %s' % (prefix, uri, repr(union.as_string()))) |
36 print(" ", prefix, uri, "source:", highlight(repr(union.as_string())[1:-1], 'RQL')) |
36 t = time() |
37 t = time() |
37 if server.DEBUG & server.DBG_MORE: |
38 if server.DEBUG & server.DBG_MORE: |
38 print(' args', repr(args)) |
39 print(' args', repr(args)) |
39 print(' cache key', cachekey) |
40 print(' cache key', cachekey) |
40 print(' solutions', ','.join(str(s.solutions) |
41 print(' solutions', ','.join(str(s.solutions) |