Skip to content
Snippets Groups Projects
Commit df73e065 authored by smagnin's avatar smagnin
Browse files

Correct pylint

parent ec784ff1
No related branches found
No related tags found
1 merge request!21Add ZIP archives support
......@@ -70,6 +70,7 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
metadata[name] = metadata_files
return metadata
# pylint: disable=too-many-branches
def _parse_files(self) -> tuple:
metadata = {} # type: dict
caller = sys._getframe(1).f_code.co_name
......@@ -132,7 +133,6 @@ class ArchiveBasedAbstractParser(abstract.AbstractParser):
if abort:
os.remove(self.output_filename)
return metadata, abort
# pylint: disable=too-many-branches
def remove_all(self) -> bool:
ret = self._parse_files()
......
......@@ -74,11 +74,12 @@ def show_meta(filename: str):
for k, v in metadata:
zipmeta = v
zipmeta_name = v
try: # FIXME this is ugly.
if not isinstance(zipmeta, dict):
print(" %s: %s" % (k, v))
except UnicodeEncodeError:
print(" %s: harmful content" % k)
print(" %s: harmful content" % zipmeta_name)
if mtype == "application/zip":
print("[+] Metadata for files inside the archive :")
if isinstance(zipmeta, dict):
......@@ -88,7 +89,7 @@ def show_meta(filename: str):
for meta_name, meta in metas.items():
print(" %s: %s" % (meta_name, meta))
except UnicodeEncodeError:
print(" %s: harmful content" % k)
print(" %s: harmful content" % zipmeta_name)
def clean_meta(filename: str, is_lightweight: bool, policy: UnknownMemberPolicy) -> bool:
if not __check_file(filename, os.R_OK|os.W_OK):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment