Commit 2467e293 authored by Jérome Perrin's avatar Jérome Perrin Committed by Arnaud Fontaine

web: pylint (py3)

parent db7e231e
......@@ -442,7 +442,7 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin):
return result
def _edit(self, **kw):
def _edit(self, *args, **kw):
# XXX it is unclear if we should keep this behavior in other potential subclasses.
# Probably yes.
if self.getPortalType() in WEB_SECTION_PORTAL_TYPE_TUPLE:
......@@ -453,4 +453,4 @@ class WebSection(Domain, DocumentExtensibleTraversableMixin):
else:
# cleanup beforeTraverse hooks that may exist after this document was cloned.
self._cleanupBeforeTraverseHooks()
super(WebSection, self)._edit(**kw)
super(WebSection, self)._edit(*args, **kw)
......@@ -60,6 +60,9 @@ class HtmlParseHelper(HTMLParser):
self.result.append(("pi", data))
def unknown_decl(self, data):
self.result.append(("unknown_decl", data))
def error(self, message):
raise ValueError(message)
def parseHtml(text):
"""
......
......@@ -194,7 +194,7 @@ def handleHrefObject(obj, src, default_mimetype="text/html", default_data=b"<p>L
data = bytes(obj.data or b"")
else:
data = getattr(obj, "getData", lambda: bytes(obj))() or b""
if six.PY2 and isinstance(data, unicode):
if six.PY2 and isinstance(data, unicode): # pylint:disable=undefined-variable
data = data.encode("utf-8")
assert isinstance(data, bytes)
return handleLinkedData(mime, data, src)
......@@ -205,7 +205,7 @@ def handleHrefObject(obj, src, default_mimetype="text/html", default_data=b"<p>L
# use the same behavior as when we call a script from browser URL bar.
if not hasattr(obj, "getPortalType") and callable(obj):
mime, data = "text/html", obj()
if six.PY2 and isinstance(data, unicode):
if six.PY2 and isinstance(data, unicode): # pylint:disable=undefined-variable
data = data.encode("utf-8")
return handleLinkedData(mime, data, src)
......
......@@ -148,7 +148,9 @@ for attachment in attachment_list:
for key, value in attachment.get("add_header_list", []):
part.add_header(key, value)
if attachment.get("filename", None) is not None:
part.add_header("Content-Disposition", "attachment", attachment["filename"])
# XXX disable too-many-function-args because there is no error with this code,
# but it might just be not tested.
part.add_header("Content-Disposition", "attachment", attachment["filename"]) # pylint:disable=too-many-function-args
outer.attach(part)
#return outer.as_string()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment