From 8459d9c68ba41d9859e01d4bf09a87ae504c1586 Mon Sep 17 00:00:00 2001 From: aaronkaplan Date: Mon, 15 Jan 2024 10:04:19 +0100 Subject: [PATCH] fix some minor quirks with pycodestyle complaining about whitespaces... --- Makefile | 8 ++++++++ parsers/sysdiagnose-shutdownlogs.py | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6cd2740 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ + +test: *.py parsers/* analyzers/* + python -m pytest --verbose tests + # or: nosetests -v + + +lint: *.py parsers/* analyzers/* + pycodestyle --exclude=venv --ignore=errors=E221,E225,E251,E501,E266,E302 --max-line-length=128 $(git ls-files '*.py') diff --git a/parsers/sysdiagnose-shutdownlogs.py b/parsers/sysdiagnose-shutdownlogs.py index 3e5bb76..8295d8d 100644 --- a/parsers/sysdiagnose-shutdownlogs.py +++ b/parsers/sysdiagnose-shutdownlogs.py @@ -23,7 +23,7 @@ # --------------------------------------------# -CLIENTS_ARE_STILL_HERE_LINE = "these clients are still here" +CLIENTS_ARE_STILL_HERE_LINE = "these clients are still here" REMAINING_CLIENT_PID_LINE = "remaining client pid" SIGTERM_LINE = "SIGTERM" @@ -47,13 +47,13 @@ def parse_shutdownlog(filepath, ios_version=16): # look for begining of shutdown sequence if CLIENTS_ARE_STILL_HERE_LINE in log_lines[index]: running_processes = [] - while not(SIGTERM_LINE in log_lines[index]): + while not (SIGTERM_LINE in log_lines[index]): if (REMAINING_CLIENT_PID_LINE in log_lines[index]): result = re.search(r".*: (\b\d+) \((.*)\).*", log_lines[index]) pid = result.groups()[0] binary_path = result.groups()[1] process = pid + ":" + binary_path - if not(process in running_processes): + if not (process in running_processes): running_processes.append(process) index += 1 # compute timestamp from SIGTERM line