mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Split stdlib into Python 2 and 3 versions (#5442)
All new files in stdlib/@python2 are straight copies of the corresponding files in stdlib.
This commit is contained in:
79
stdlib/@python2/pyexpat/__init__.pyi
Normal file
79
stdlib/@python2/pyexpat/__init__.pyi
Normal file
@@ -0,0 +1,79 @@
|
||||
import pyexpat.errors as errors
|
||||
import pyexpat.model as model
|
||||
from _typeshed import SupportsRead
|
||||
from typing import Any, Callable, Dict, List, Optional, Text, Tuple, Union
|
||||
|
||||
EXPAT_VERSION: str # undocumented
|
||||
version_info: Tuple[int, int, int] # undocumented
|
||||
native_encoding: str # undocumented
|
||||
features: List[Tuple[str, int]] # undocumented
|
||||
|
||||
class ExpatError(Exception):
|
||||
code: int
|
||||
lineno: int
|
||||
offset: int
|
||||
|
||||
error = ExpatError
|
||||
|
||||
XML_PARAM_ENTITY_PARSING_NEVER: int
|
||||
XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE: int
|
||||
XML_PARAM_ENTITY_PARSING_ALWAYS: int
|
||||
|
||||
_Model = Tuple[int, int, Optional[str], Tuple[Any, ...]]
|
||||
|
||||
class XMLParserType(object):
|
||||
def Parse(self, __data: Union[Text, bytes], __isfinal: bool = ...) -> int: ...
|
||||
def ParseFile(self, __file: SupportsRead[bytes]) -> int: ...
|
||||
def SetBase(self, __base: Text) -> None: ...
|
||||
def GetBase(self) -> Optional[str]: ...
|
||||
def GetInputContext(self) -> Optional[bytes]: ...
|
||||
def ExternalEntityParserCreate(self, __context: Optional[Text], __encoding: Text = ...) -> XMLParserType: ...
|
||||
def SetParamEntityParsing(self, __flag: int) -> int: ...
|
||||
def UseForeignDTD(self, __flag: bool = ...) -> None: ...
|
||||
buffer_size: int
|
||||
buffer_text: bool
|
||||
buffer_used: int
|
||||
namespace_prefixes: bool # undocumented
|
||||
ordered_attributes: bool
|
||||
specified_attributes: bool
|
||||
ErrorByteIndex: int
|
||||
ErrorCode: int
|
||||
ErrorColumnNumber: int
|
||||
ErrorLineNumber: int
|
||||
CurrentByteIndex: int
|
||||
CurrentColumnNumber: int
|
||||
CurrentLineNumber: int
|
||||
XmlDeclHandler: Optional[Callable[[str, Optional[str], int], Any]]
|
||||
StartDoctypeDeclHandler: Optional[Callable[[str, Optional[str], Optional[str], bool], Any]]
|
||||
EndDoctypeDeclHandler: Optional[Callable[[], Any]]
|
||||
ElementDeclHandler: Optional[Callable[[str, _Model], Any]]
|
||||
AttlistDeclHandler: Optional[Callable[[str, str, str, Optional[str], bool], Any]]
|
||||
StartElementHandler: Optional[
|
||||
Union[
|
||||
Callable[[str, Dict[str, str]], Any],
|
||||
Callable[[str, List[str]], Any],
|
||||
Callable[[str, Union[Dict[str, str]], List[str]], Any],
|
||||
]
|
||||
]
|
||||
EndElementHandler: Optional[Callable[[str], Any]]
|
||||
ProcessingInstructionHandler: Optional[Callable[[str, str], Any]]
|
||||
CharacterDataHandler: Optional[Callable[[str], Any]]
|
||||
UnparsedEntityDeclHandler: Optional[Callable[[str, Optional[str], str, Optional[str], str], Any]]
|
||||
EntityDeclHandler: Optional[Callable[[str, bool, Optional[str], Optional[str], str, Optional[str], Optional[str]], Any]]
|
||||
NotationDeclHandler: Optional[Callable[[str, Optional[str], str, Optional[str]], Any]]
|
||||
StartNamespaceDeclHandler: Optional[Callable[[str, str], Any]]
|
||||
EndNamespaceDeclHandler: Optional[Callable[[str], Any]]
|
||||
CommentHandler: Optional[Callable[[str], Any]]
|
||||
StartCdataSectionHandler: Optional[Callable[[], Any]]
|
||||
EndCdataSectionHandler: Optional[Callable[[], Any]]
|
||||
DefaultHandler: Optional[Callable[[str], Any]]
|
||||
DefaultHandlerExpand: Optional[Callable[[str], Any]]
|
||||
NotStandaloneHandler: Optional[Callable[[], int]]
|
||||
ExternalEntityRefHandler: Optional[Callable[[str, Optional[str], Optional[str], Optional[str]], int]]
|
||||
|
||||
def ErrorString(__code: int) -> str: ...
|
||||
|
||||
# intern is undocumented
|
||||
def ParserCreate(
|
||||
encoding: Optional[Text] = ..., namespace_separator: Optional[Text] = ..., intern: Optional[Dict[str, Any]] = ...
|
||||
) -> XMLParserType: ...
|
||||
44
stdlib/@python2/pyexpat/errors.pyi
Normal file
44
stdlib/@python2/pyexpat/errors.pyi
Normal file
@@ -0,0 +1,44 @@
|
||||
import sys
|
||||
from typing import Dict
|
||||
|
||||
if sys.version_info >= (3, 2):
|
||||
codes: Dict[str, int]
|
||||
messages: Dict[int, str]
|
||||
|
||||
XML_ERROR_ABORTED: str
|
||||
XML_ERROR_ASYNC_ENTITY: str
|
||||
XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF: str
|
||||
XML_ERROR_BAD_CHAR_REF: str
|
||||
XML_ERROR_BINARY_ENTITY_REF: str
|
||||
XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING: str
|
||||
XML_ERROR_DUPLICATE_ATTRIBUTE: str
|
||||
XML_ERROR_ENTITY_DECLARED_IN_PE: str
|
||||
XML_ERROR_EXTERNAL_ENTITY_HANDLING: str
|
||||
XML_ERROR_FEATURE_REQUIRES_XML_DTD: str
|
||||
XML_ERROR_FINISHED: str
|
||||
XML_ERROR_INCOMPLETE_PE: str
|
||||
XML_ERROR_INCORRECT_ENCODING: str
|
||||
XML_ERROR_INVALID_TOKEN: str
|
||||
XML_ERROR_JUNK_AFTER_DOC_ELEMENT: str
|
||||
XML_ERROR_MISPLACED_XML_PI: str
|
||||
XML_ERROR_NOT_STANDALONE: str
|
||||
XML_ERROR_NOT_SUSPENDED: str
|
||||
XML_ERROR_NO_ELEMENTS: str
|
||||
XML_ERROR_NO_MEMORY: str
|
||||
XML_ERROR_PARAM_ENTITY_REF: str
|
||||
XML_ERROR_PARTIAL_CHAR: str
|
||||
XML_ERROR_PUBLICID: str
|
||||
XML_ERROR_RECURSIVE_ENTITY_REF: str
|
||||
XML_ERROR_SUSPENDED: str
|
||||
XML_ERROR_SUSPEND_PE: str
|
||||
XML_ERROR_SYNTAX: str
|
||||
XML_ERROR_TAG_MISMATCH: str
|
||||
XML_ERROR_TEXT_DECL: str
|
||||
XML_ERROR_UNBOUND_PREFIX: str
|
||||
XML_ERROR_UNCLOSED_CDATA_SECTION: str
|
||||
XML_ERROR_UNCLOSED_TOKEN: str
|
||||
XML_ERROR_UNDECLARING_PREFIX: str
|
||||
XML_ERROR_UNDEFINED_ENTITY: str
|
||||
XML_ERROR_UNEXPECTED_STATE: str
|
||||
XML_ERROR_UNKNOWN_ENCODING: str
|
||||
XML_ERROR_XML_DECL: str
|
||||
11
stdlib/@python2/pyexpat/model.pyi
Normal file
11
stdlib/@python2/pyexpat/model.pyi
Normal file
@@ -0,0 +1,11 @@
|
||||
XML_CTYPE_ANY: int
|
||||
XML_CTYPE_CHOICE: int
|
||||
XML_CTYPE_EMPTY: int
|
||||
XML_CTYPE_MIXED: int
|
||||
XML_CTYPE_NAME: int
|
||||
XML_CTYPE_SEQ: int
|
||||
|
||||
XML_CQUANT_NONE: int
|
||||
XML_CQUANT_OPT: int
|
||||
XML_CQUANT_PLUS: int
|
||||
XML_CQUANT_REP: int
|
||||
Reference in New Issue
Block a user