web/request.py
changeset 10612 84468b90e9c1
parent 10605 61521bee2b68
child 10618 3274a1648c7e
equal deleted inserted replaced
10611:f4dec0cca9a1 10612:84468b90e9c1
    26 from hashlib import sha1 # pylint: disable=E0611
    26 from hashlib import sha1 # pylint: disable=E0611
    27 from calendar import timegm
    27 from calendar import timegm
    28 from datetime import date, datetime
    28 from datetime import date, datetime
    29 from warnings import warn
    29 from warnings import warn
    30 
    30 
       
    31 from six import string_types
    31 from six.moves import http_client
    32 from six.moves import http_client
    32 from six.moves.urllib.parse import urlsplit, quote as urlquote
    33 from six.moves.urllib.parse import urlsplit, quote as urlquote
    33 from six.moves.http_cookies import SimpleCookie
    34 from six.moves.http_cookies import SimpleCookie
    34 
    35 
    35 from rql.utils import rqlvar_maker
    36 from rql.utils import rqlvar_maker
   435         form = self.form
   436         form = self.form
   436         try:
   437         try:
   437             eids = form['eid']
   438             eids = form['eid']
   438         except KeyError:
   439         except KeyError:
   439             raise NothingToEdit(self._('no selected entities'))
   440             raise NothingToEdit(self._('no selected entities'))
   440         if isinstance(eids, basestring):
   441         if isinstance(eids, string_types):
   441             eids = (eids,)
   442             eids = (eids,)
   442         for peid in eids:
   443         for peid in eids:
   443             if withtype:
   444             if withtype:
   444                 typekey = '__type:%s' % peid
   445                 typekey = '__type:%s' % peid
   445                 assert typekey in form, 'no entity type specified'
   446                 assert typekey in form, 'no entity type specified'
   594 
   595 
   595         :param jsfiles: a JS filename or a list of JS filenames
   596         :param jsfiles: a JS filename or a list of JS filenames
   596         :param localfile: if True, the default data dir prefix is added to the
   597         :param localfile: if True, the default data dir prefix is added to the
   597                           JS filename
   598                           JS filename
   598         """
   599         """
   599         if isinstance(jsfiles, basestring):
   600         if isinstance(jsfiles, string_types):
   600             jsfiles = (jsfiles,)
   601             jsfiles = (jsfiles,)
   601         for jsfile in jsfiles:
   602         for jsfile in jsfiles:
   602             if localfile:
   603             if localfile:
   603                 jsfile = self.data_url(jsfile)
   604                 jsfile = self.data_url(jsfile)
   604             self.html_headers.add_js(jsfile)
   605             self.html_headers.add_js(jsfile)
   614         :param ieonly: True if this css is specific to IE
   615         :param ieonly: True if this css is specific to IE
   615         :param iespec: conditional expression that will be used around
   616         :param iespec: conditional expression that will be used around
   616                        the css inclusion. cf:
   617                        the css inclusion. cf:
   617                        http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx
   618                        http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx
   618         """
   619         """
   619         if isinstance(cssfiles, basestring):
   620         if isinstance(cssfiles, string_types):
   620             cssfiles = (cssfiles,)
   621             cssfiles = (cssfiles,)
   621         if ieonly:
   622         if ieonly:
   622             if self.ie_browser():
   623             if self.ie_browser():
   623                 extraargs = [iespec]
   624                 extraargs = [iespec]
   624                 add_css = self.html_headers.add_ie_css
   625                 add_css = self.html_headers.add_ie_css