Skip to content

Add missing stdlib xml stubs #5895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
Aug 9, 2021
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8cafdb1
Finish BasicAuthHandler missing stubs
stackswithans Sep 23, 2020
5a5cf8f
Fix style stuff
stackswithans Sep 23, 2020
c4b9db9
Remove bad file
stackswithans Sep 23, 2020
e6f6276
tweak .gitignore
stackswithans Sep 23, 2020
4763b63
Add missing methods to ftp handlers
stackswithans Sep 23, 2020
eb857cb
Add FancyURLopener methods
stackswithans Sep 24, 2020
75e8f6a
Merge remote-tracking branch 'upstream/master'
stackswithans Sep 24, 2020
fcae477
Merge branch 'master' into issue-4527
stackswithans Sep 24, 2020
8f9eb70
Add FileHandler channel
stackswithans Sep 24, 2020
703e571
Add HTTPCookieProcessor missing stubs
stackswithans Sep 24, 2020
358c5f3
Update .gitignore
stackswithans Sep 24, 2020
c58349f
Modify .gitignore
stackswithans Sep 24, 2020
59ae776
Add stubs 3 more objects
stackswithans Sep 24, 2020
a57cdbf
revert .gitignore
stackswithans Sep 24, 2020
27fbb2d
Add stubs for HTTPPasswordMgr
stackswithans Sep 24, 2020
78c9a17
Add stubs for HTTPRedirectHandler
stackswithans Sep 24, 2020
dfee4d3
tweak .travis.yml
stackswithans Sep 24, 2020
37bd617
tweak self_test
stackswithans Sep 24, 2020
2c4513b
tweak .travis.yml
stackswithans Sep 24, 2020
233d0a4
Add stubs for OpenerDirector
stackswithans Sep 24, 2020
4e7e466
Add stubs for ProxyHandlers
stackswithans Sep 24, 2020
54144e0
Add Request stub
stackswithans Sep 24, 2020
f57027e
Add URLopener stubs
stackswithans Sep 24, 2020
195264a
Revert tweaks
stackswithans Sep 24, 2020
1b26ae2
Fix formatting
stackswithans Sep 24, 2020
a1490be
Make requested changes
stackswithans Sep 25, 2020
74b6f04
Fix formatting
stackswithans Sep 25, 2020
1fbc51e
Merge remote-tracking branch 'upstream/master'
stackswithans Sep 25, 2020
39a636c
Merge branch 'python:master' into master
stackswithans Aug 8, 2021
31135d3
Add/modify pulldom annotations
stackswithans Aug 9, 2021
0a7a0e9
Fix imports
stackswithans Aug 9, 2021
5a3a27a
Fix union syntax bug
stackswithans Aug 9, 2021
d3b2e47
Use typing module Tuple class
stackswithans Aug 9, 2021
e6d883e
Remove wrong annotation
stackswithans Aug 9, 2021
8ef92d5
Make requested changes
stackswithans Aug 9, 2021
5379d82
Fix s&r error
stackswithans Aug 9, 2021
eddde00
Fix typo
stackswithans Aug 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 37 additions & 19 deletions stdlib/xml/dom/pulldom.pyi
Original file line number Diff line number Diff line change
@@ -1,26 +1,44 @@
from typing import IO, Any
from typing import IO, Any, Sequence, Tuple, Union
from typing_extensions import Literal
from xml.dom.minidom import Document, DOMImplementation, Element, Text
from xml.sax.handler import ContentHandler
from xml.sax.xmlreader import XMLReader

START_ELEMENT: str
END_ELEMENT: str
COMMENT: str
START_DOCUMENT: str
END_DOCUMENT: str
PROCESSING_INSTRUCTION: str
IGNORABLE_WHITESPACE: str
CHARACTERS: str
START_ELEMENT: Literal["START_ELEMENT"]
END_ELEMENT: Literal["END_ELEMENT"]
COMMENT: Literal["COMMENT"]
START_DOCUMENT: Literal["START_DOCUMENT"]
END_DOCUMENT: Literal["END_DOCUMENT"]
PROCESSING_INSTRUCTION: Literal["PROCESSING_INSTRUCTION"]
IGNORABLE_WHITESPACE: Literal["IGNORABLE_WHITESPACE"]
CHARACTERS: Literal["CHARACTERS"]

_DocumentFactory = Union[DOMImplementation, None]
_Node = Union[Document, Element, Text]

_Event = Tuple[
Literal[
Literal["START_ELEMENT"],
Literal["END_ELEMENT"],
Literal["COMMENT"],
Literal["START_DOCUMENT"],
Literal["END_DOCUMENT"],
Literal["PROCESSING_INSTRUCTION"],
Literal["IGNORABLE_WHITESPACE"],
Literal["CHARACTERS"],
],
_Node,
]

class PullDOM(ContentHandler):
document: Any | None
documentFactory: Any
document: Document | None
documentFactory: _DocumentFactory
firstEvent: Any
lastEvent: Any
elementStack: Any
push: Any
pending_events: Any
def __init__(self, documentFactory: Any | None = ...) -> None: ...
def pop(self): ...
elementStack: Sequence[Any]
pending_events: Sequence[Any]
def __init__(self, documentFactory: _DocumentFactory = ...) -> None: ...
def pop(self) -> Element: ...
def setDocumentLocator(self, locator) -> None: ...
def startPrefixMapping(self, prefix, uri) -> None: ...
def endPrefixMapping(self, prefix) -> None: ...
Expand Down Expand Up @@ -48,12 +66,12 @@ class DOMEventStream:
bufsize: int
def __init__(self, stream: IO[bytes], parser: XMLReader, bufsize: int) -> None: ...
pulldom: Any
def reset(self) -> None: ...
def __getitem__(self, pos): ...
def __next__(self): ...
def __iter__(self): ...
def expandNode(self, node) -> None: ...
def getEvent(self): ...
def getEvent(self) -> _Event: ...
def expandNode(self, node: _Node) -> None: ...
def reset(self) -> None: ...
def clear(self) -> None: ...

class SAX2DOM(PullDOM):
Expand Down