jenkins-bot has submitted this change and it was merged.
Change subject: pyflakes
......................................................................
pyflakes
Copied UnicodeToAsciiHtml from compat.
Change-Id: Ie6eb7839c0fc9f7ccd7fcfa7f24c5b93eac561ea
---
M pywikibot/page.py
1 file changed, 14 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 6e658d0..2a42e9f 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -15,6 +15,7 @@
from pywikibot import deprecated
from pywikibot import config
import pywikibot.site
+from pywikibot.exceptions import AutoblockUser, UserActionRefuse
from pywikibot.tools import ComparableMixin
import hashlib
@@ -3104,7 +3105,7 @@
@param sources: the sources to remove
@type sources: list of pywikibot.Claim
"""
- data = self.repo.removeSources(self, sources, **kwargs)
+ self.repo.removeSources(self, sources, **kwargs)
for source in sources:
source_dict = collections.defaultdict(list)
source_dict[source.getID()].append(source)
@@ -3633,6 +3634,18 @@
return result
+def UnicodeToAsciiHtml(s):
+ """Convert unicode to a bytestring using HTML
entities."""
+ html = []
+ for c in s:
+ cord = ord(c)
+ if 31 < cord < 128:
+ html.append(c)
+ else:
+ html.append('&#%d;' % cord)
+ return ''.join(html)
+
+
def unicode2html(x, encoding):
"""
Ensure unicode string is encodable, or else convert to ASCII for HTML.
--
To view, visit
https://gerrit.wikimedia.org/r/141904
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie6eb7839c0fc9f7ccd7fcfa7f24c5b93eac561ea
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>