Project

General

Profile

« Previous | Next » 

Revision 5143

strings.py: Added json_encode()

View differences:

strings.py
78 78
    str_ = str_.replace(quote, quote_esc)
79 79
    return str_
80 80

  
81
def json_encode(str_): return esc_quotes(str_, '"')
82

  
81 83
def esc_for_mogrify(query):
82 84
    '''Escapes a query right before being passed to a mogrifying function.'''
83 85
    return query.replace('%', '%%')

Also available in: Unified diff