ext/rest.py
changeset 10212 dccce2be3101
parent 10023 c3ab46842b2d
child 10588 fdaa0e4b7eaf
child 10957 2fdf67ef3341
equal deleted inserted replaced
10211:59a77e8847bc 10212:dccce2be3101
    32 * `rql-table`, create a table from a RQL query
    32 * `rql-table`, create a table from a RQL query
    33 
    33 
    34 """
    34 """
    35 __docformat__ = "restructuredtext en"
    35 __docformat__ = "restructuredtext en"
    36 
    36 
    37 from cStringIO import StringIO
       
    38 from itertools import chain
    37 from itertools import chain
    39 from logging import getLogger
    38 from logging import getLogger
    40 from os.path import join
    39 from os.path import join
    41 from urlparse import urlsplit
    40 from urlparse import urlsplit
    42 
    41 
   403     else:
   402     else:
   404         encoding = req.encoding
   403         encoding = req.encoding
   405         # remove unprintable characters unauthorized in xml
   404         # remove unprintable characters unauthorized in xml
   406         data = data.translate(ESC_CAR_TABLE)
   405         data = data.translate(ESC_CAR_TABLE)
   407     settings = {'input_encoding': encoding, 'output_encoding': 'unicode',
   406     settings = {'input_encoding': encoding, 'output_encoding': 'unicode',
   408                 'warning_stream': StringIO(),
   407                 'warning_stream': False,
   409                 'traceback': True, # don't sys.exit
   408                 'traceback': True, # don't sys.exit
   410                 'stylesheet': None, # don't try to embed stylesheet (may cause
   409                 'stylesheet': None, # don't try to embed stylesheet (may cause
   411                                     # obscure bug due to docutils computing
   410                                     # obscure bug due to docutils computing
   412                                     # relative path according to the directory
   411                                     # relative path according to the directory
   413                                     # used *at import time*
   412                                     # used *at import time*