コード例 #1
0
    def __new__(cls, base=u'', encoding=None, errors='strict'):
        if hasattr(base, '__html__'):
            base = base.__html__()
        if encoding is None:
            # using class to create new object.
            return text_type.__new__(cls, base)
		#just use str.__new__ prototype
        return text_type.__new__(cls, base, encoding, errors)
コード例 #2
0
ファイル: __init__.py プロジェクト: kelvinkipsang/python_proj
 def __new__(cls, base=u'', encoding=None, errors='strict'):
     if hasattr(base, '__html__'):
         base = base.__html__()
     if encoding is None:
         return text_type.__new__(cls, base)
     return text_type.__new__(cls, base, encoding, errors)
コード例 #3
0
ファイル: __init__.py プロジェクト: mredar/markupsafe
 def __new__(cls, base=u'', encoding=None, errors='strict'):
     if hasattr(base, '__html__'):
         base = base.__html__()
     if encoding is None:
         return text_type.__new__(cls, base)
     return text_type.__new__(cls, base, encoding, errors)
コード例 #4
0
ファイル: __init__.py プロジェクト: Jonathankaoma/QGIS
 def __new__(cls, base=u"", encoding=None, errors="strict"):
     if hasattr(base, "__html__"):
         base = base.__html__()
     if encoding is None:
         return text_type.__new__(cls, base)
     return text_type.__new__(cls, base, encoding, errors)
コード例 #5
0
 def __new__(cls, base=u"", encoding=None, errors="strict"):
     if hasattr(base, "__html__"):
         base = base.__html__()
     if encoding is None:
         return text_type.__new__(cls, base)
     return text_type.__new__(cls, base, encoding, errors)