jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/783440 )
Change subject: [cleanup] Remove unused xmlreader.XmlParserThread
......................................................................
[cleanup] Remove unused xmlreader.XmlParserThread
xmlreader.XmlParserThread isn't uses in the framework. It was introduced
2005 with
https://static-codereview.wikimedia.org/pywikipedia/2003.html
and was given up in 2006 when the parser was changed from xml.sax to
xml.etree.
Its handler was never ported to core. Thus no deprecation period is
necessary beause this class never worked with core.
Change-Id: Ia38681a481e43df2a4a006e39d25f82a5a0f9e34
---
M pywikibot/xmlreader.py
1 file changed, 0 insertions(+), 25 deletions(-)
Approvals:
JJMC89: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/xmlreader.py b/pywikibot/xmlreader.py
index 5437a82..02e1bcf 100644
--- a/pywikibot/xmlreader.py
+++ b/pywikibot/xmlreader.py
@@ -13,8 +13,6 @@
# Distributed under the terms of the MIT license.
#
import re
-import threading
-import xml.sax
from xml.etree.ElementTree import iterparse
from pywikibot.tools import open_archive
@@ -66,29 +64,6 @@
self.isredirect = redirect
-class XmlParserThread(threading.Thread):
-
- """
- XML parser that will run as a single thread.
-
- This allows the XmlDump
- generator to yield pages before the parser has finished reading the
- entire dump.
-
- There surely are more elegant ways to do this.
- """
-
- def __init__(self, filename, handler) -> None:
- """Initializer."""
- super().__init__()
- self.filename = filename
- self.handler = handler
-
- def run(self) -> None:
- """Parse the file in a single thread."""
- xml.sax.parse(self.filename, self.handler)
-
-
class XmlDump:
"""
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/783440
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ia38681a481e43df2a4a006e39d25f82a5a0f9e34
Gerrit-Change-Number: 783440
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged