cubicweb/server/sources/__init__.py
changeset 12758 db95a417a5ec
parent 12739 c6f8ca03718f
equal deleted inserted replaced
12757:e55f6f6a8d28 12758:db95a417a5ec
    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 from cubicweb.misc.source_highlight import highlight_terminal
    31 
    31 
    32 
    32 
    33 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'):
    34     if server.DEBUG & server.DBG_RQL:
    34     if server.DEBUG & server.DBG_RQL:
    35         global t
    35         global t
    36         print(" ", prefix, uri, "source:", highlight(repr(union.as_string())[1:-1], 'RQL'))
    36         print(" ", prefix, uri, "source:", highlight_terminal(repr(union.as_string())[1:-1], 'RQL'))
    37         t = time()
    37         t = time()
    38         if server.DEBUG & server.DBG_MORE:
    38         if server.DEBUG & server.DBG_MORE:
    39             print('    args', repr(args))
    39             print('    args', repr(args))
    40             print('    cache key', cachekey)
    40             print('    cache key', cachekey)
    41             print('    solutions', ','.join(str(s.solutions)
    41             print('    solutions', ','.join(str(s.solutions)