-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Expand file tree
/
Copy pathxmlreader.pyi
More file actions
90 lines (82 loc) · 4.25 KB
/
xmlreader.pyi
File metadata and controls
90 lines (82 loc) · 4.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
from _typeshed import ReadableBuffer
from collections.abc import Mapping
from typing import Generic, Literal, TypeVar, overload
from typing_extensions import Self, TypeAlias
from xml.sax import _Source, _SupportsReadClose
from xml.sax.handler import _ContentHandlerProtocol, _DTDHandlerProtocol, _EntityResolverProtocol, _ErrorHandlerProtocol
class XMLReader:
def parse(self, source: InputSource | _Source) -> None: ...
def getContentHandler(self) -> _ContentHandlerProtocol: ...
def setContentHandler(self, handler: _ContentHandlerProtocol) -> None: ...
def getDTDHandler(self) -> _DTDHandlerProtocol: ...
def setDTDHandler(self, handler: _DTDHandlerProtocol) -> None: ...
def getEntityResolver(self) -> _EntityResolverProtocol: ...
def setEntityResolver(self, resolver: _EntityResolverProtocol) -> None: ...
def getErrorHandler(self) -> _ErrorHandlerProtocol: ...
def setErrorHandler(self, handler: _ErrorHandlerProtocol) -> None: ...
def setLocale(self, locale: str) -> None: ...
def getFeature(self, name: str) -> Literal[0, 1] | bool: ...
def setFeature(self, name: str, state: Literal[0, 1] | bool) -> None: ...
def getProperty(self, name: str) -> object: ...
def setProperty(self, name: str, value: object) -> None: ...
class IncrementalParser(XMLReader):
def __init__(self, bufsize: int = 65536) -> None: ...
def parse(self, source: InputSource | _Source) -> None: ...
def feed(self, data: str | ReadableBuffer) -> None: ...
def prepareParser(self, source: InputSource) -> None: ...
def close(self) -> None: ...
def reset(self) -> None: ...
class Locator:
def getColumnNumber(self) -> int | None: ...
def getLineNumber(self) -> int | None: ...
def getPublicId(self) -> str | None: ...
def getSystemId(self) -> str | None: ...
class InputSource:
def __init__(self, system_id: str | None = None) -> None: ...
def setPublicId(self, public_id: str | None) -> None: ...
def getPublicId(self) -> str | None: ...
def setSystemId(self, system_id: str | None) -> None: ...
def getSystemId(self) -> str | None: ...
def setEncoding(self, encoding: str | None) -> None: ...
def getEncoding(self) -> str | None: ...
def setByteStream(self, bytefile: _SupportsReadClose[bytes] | None) -> None: ...
def getByteStream(self) -> _SupportsReadClose[bytes] | None: ...
def setCharacterStream(self, charfile: _SupportsReadClose[str] | None) -> None: ...
def getCharacterStream(self) -> _SupportsReadClose[str] | None: ...
_AttrKey = TypeVar("_AttrKey", default=str)
class AttributesImpl(Generic[_AttrKey]):
def __init__(self, attrs: Mapping[_AttrKey, str]) -> None: ...
def getLength(self) -> int: ...
def getType(self, name: str) -> str: ...
def getValue(self, name: _AttrKey) -> str: ...
def getValueByQName(self, name: str) -> str: ...
def getNameByQName(self, name: str) -> _AttrKey: ...
def getQNameByName(self, name: _AttrKey) -> str: ...
def getNames(self) -> list[_AttrKey]: ...
def getQNames(self) -> list[str]: ...
def __len__(self) -> int: ...
def __getitem__(self, name: _AttrKey) -> str: ...
def keys(self) -> list[_AttrKey]: ...
def __contains__(self, name: _AttrKey) -> bool: ...
@overload
def get(self, name: _AttrKey, alternative: None = None) -> str | None: ...
@overload
def get(self, name: _AttrKey, alternative: str) -> str: ...
def copy(self) -> Self: ...
def items(self) -> list[tuple[_AttrKey, str]]: ...
def values(self) -> list[str]: ...
_NSName: TypeAlias = tuple[str | None, str]
class AttributesNSImpl(AttributesImpl[_NSName]):
def __init__(self, attrs: Mapping[_NSName, str], qnames: Mapping[_NSName, str]) -> None: ...
def getValue(self, name: _NSName) -> str: ...
def getNameByQName(self, name: str) -> _NSName: ...
def getQNameByName(self, name: _NSName) -> str: ...
def getNames(self) -> list[_NSName]: ...
def __getitem__(self, name: _NSName) -> str: ...
def keys(self) -> list[_NSName]: ...
def __contains__(self, name: _NSName) -> bool: ...
@overload
def get(self, name: _NSName, alternative: None = None) -> str | None: ...
@overload
def get(self, name: _NSName, alternative: str) -> str: ...
def items(self) -> list[tuple[_NSName, str]]: ...