コード例 #1
0
ファイル: expatreader.py プロジェクト: 498330580/yaoling-web
 def __init__(self, namespaceHandling=0, bufsize=2 ** 16 - 20,
              forbid_dtd=False, forbid_entities=True,
              forbid_external=True):
     _ExpatParser.__init__(self, namespaceHandling, bufsize)
     self.forbid_dtd = forbid_dtd
     self.forbid_entities = forbid_entities
     self.forbid_external = forbid_external
コード例 #2
0
    def __init__(self, *args, **kwargs):
        """docstring for __init__"""
        ExpatParser.__init__(self, *args, **kwargs)

        class _NiftyEntityResolver(EntityResolver):
            """
            _NiftyEntityResolver makes the entity errors disappear.
            
            It works by the html spec which says that external entities that
            can not resolved, do not have to be reported as an error by a non
            validating parser.
            """
            def resolveEntity(self, publicId, systemId):
                "This will be called with None, None if it is an unknown entity"
                if systemId or publicId:
                    return EntityResolver.resolveEntity(
                        self, publicId, systemId)

                # return an empty stringio in which the parser can never find
                # the entities. This will make it skip the entity, which triggers
                # skippedEntity in the contenthandler.
                return StringIO.StringIO(
                    " ")  # if you delete that single space you will be sorry.

        self.setEntityResolver(_NiftyEntityResolver())
コード例 #3
0
ファイル: xmlutils.py プロジェクト: MechanisM/django-easymode
 def __init__(self, *args, **kwargs):
     """docstring for __init__"""
     ExpatParser.__init__(self, *args, **kwargs)
     
     class _NiftyEntityResolver(EntityResolver):
         """
         _NiftyEntityResolver makes the entity errors disappear.
         
         It works by the html spec which says that external entities that
         can not resolved, do not have to be reported as an error by a non
         validating parser.
         """
         def resolveEntity(self, publicId, systemId):
             "This will be called with None, None if it is an unknown entity"
             if systemId or publicId:
                  return EntityResolver.resolveEntity(self,publicId,systemId)
             
             # return an empty stringio in which the parser can never find
             # the entities. This will make it skip the entity, which triggers
             # skippedEntity in the contenthandler.
             return StringIO.StringIO(" ") # if you delete that single space you will be sorry.
     
     self.setEntityResolver(_NiftyEntityResolver())
コード例 #4
0
ファイル: ScanProsite.py プロジェクト: AkiOhtani/biopython
 def __init__(self):
     ExpatParser.__init__(self)
     self.firsttime = True
コード例 #5
0
 def __init__(self, *args, **kwargs):
     _ExpatParser.__init__(self, *args, **kwargs)
     self.setFeature(handler.feature_external_ges, False)
     self.setFeature(handler.feature_external_pes, False)
コード例 #6
0
ファイル: parser.py プロジェクト: superssnails/edd
 def __init__(self, *args, **kwargs):
     _ExpatParser.__init__(self, *args, **kwargs)
     self.setFeature(handler.feature_external_ges, False)
     self.setFeature(handler.feature_external_pes, False)
コード例 #7
0
ファイル: ScanProsite.py プロジェクト: sgalpha01/biopython
 def __init__(self):
     """Initialize the class."""
     ExpatParser.__init__(self)
     self.firsttime = True
コード例 #8
0
ファイル: ScanProsite.py プロジェクト: zellera93/biopython
 def __init__(self):
     ExpatParser.__init__(self)
     self.firsttime = True
コード例 #9
0
 def __init__(self, forbid_dtd=True, forbid_entities=True,
              *args, **kwargs):
     # Python 2.x old style class
     ExpatParser.__init__(self, *args, **kwargs)
     self.forbid_dtd = forbid_dtd
     self.forbid_entities = forbid_entities
コード例 #10
0
ファイル: xmltools.py プロジェクト: yuseitahara/ZServer
 def __init__(self, forbid_dtd=True, forbid_entities=True,
              *args, **kwargs):
     # Python 2.x old style class
     ExpatParser.__init__(self, *args, **kwargs)
     self.forbid_dtd = forbid_dtd
     self.forbid_entities = forbid_entities
コード例 #11
0
 def __init__(self):
     """Initialize the class."""
     ExpatParser.__init__(self)
     self.firsttime = True
コード例 #12
0
"""
コード例 #13
0
 def __init__(self, *args, **kwargs):
     ExpatParser.__init__(self, *args, **kwargs)
     self.__entities = {}
コード例 #14
0
 def __init__(self, *args, **kwargs):
     ExpatParser.__init__(self, *args, **kwargs)
     self.__entities = {}