cubicweb/utils.py
changeset 12743 a74e77469540
parent 12567 26744ad37953
child 12753 38d24fb2ae48
equal deleted inserted replaced
12742:ca698656251c 12743:a74e77469540
   563     'javascript: alert("%251337%");'
   563     'javascript: alert("%251337%");'
   564     """
   564     """
   565     return 'javascript: ' + PERCENT_IN_URLQUOTE_RE.sub(r'%25', javascript_code)
   565     return 'javascript: ' + PERCENT_IN_URLQUOTE_RE.sub(r'%25', javascript_code)
   566 
   566 
   567 
   567 
       
   568 def get_pdb():
       
   569     "return ipdb if its installed, otherwise pdb"
       
   570     try:
       
   571         import ipdb
       
   572     except ImportError:
       
   573         import pdb
       
   574         return pdb
       
   575     else:
       
   576         return ipdb
       
   577 
       
   578 
   568 logger = getLogger('cubicweb.utils')
   579 logger = getLogger('cubicweb.utils')
   569 
   580 
   570 class QueryCache(object):
   581 class QueryCache(object):
   571     """ a minimalist dict-like object to be used by the querier
   582     """ a minimalist dict-like object to be used by the querier
   572     and native source (replaces lgc.cache for this very usage)
   583     and native source (replaces lgc.cache for this very usage)