cubicweb/utils.py
changeset 12542 85194bd49119
parent 12508 a8c1ea390400
child 12567 26744ad37953
equal deleted inserted replaced
12541:bbbccb0b3a66 12542:85194bd49119
    33     from inspect import getfullargspec as getargspec
    33     from inspect import getfullargspec as getargspec
    34 else:
    34 else:
    35     from inspect import getargspec
    35     from inspect import getargspec
    36 from itertools import repeat
    36 from itertools import repeat
    37 from uuid import uuid4
    37 from uuid import uuid4
    38 from warnings import warn
       
    39 from threading import Lock
    38 from threading import Lock
    40 from logging import getLogger
    39 from logging import getLogger
    41 
    40 
    42 from six import text_type
    41 from six import text_type
    43 
    42 
   445         self._htmlattrs.append( (attrname, attrvalue) )
   444         self._htmlattrs.append( (attrname, attrvalue) )
   446 
   445 
   447     def set_htmlattrs(self, attrs):
   446     def set_htmlattrs(self, attrs):
   448         self._htmlattrs = attrs
   447         self._htmlattrs = attrs
   449 
   448 
   450     def set_doctype(self, doctype, reset_xmldecl=None):
   449     def set_doctype(self, doctype):
   451         self.doctype = doctype
   450         self.doctype = doctype
   452         if reset_xmldecl is not None:
       
   453             warn('[3.17] xhtml is no more supported',
       
   454                  DeprecationWarning, stacklevel=2)
       
   455 
   451 
   456     @property
   452     @property
   457     def htmltag(self):
   453     def htmltag(self):
   458         attrs = ' '.join('%s="%s"' % (attr, xml_escape(value))
   454         attrs = ' '.join('%s="%s"' % (attr, xml_escape(value))
   459                          for attr, value in self._htmlattrs)
   455                          for attr, value in self._htmlattrs)