From 1f308e9cc52fdcbb64aa53a540848d951e7e93c5 Mon Sep 17 00:00:00 2001 From: Alex Pyrgiotis Date: Mon, 27 Mar 2023 14:24:42 +0300 Subject: [PATCH] Reformat code with Black 23 Due to a bump in our Python dependencies, we now install Black 23 instead of 22, which detects some of our files as badly formatted. --- container/dangerzone.py | 1 - dangerzone/gui/logic.py | 1 - dangerzone/gui/main_window.py | 1 - dangerzone/isolation_provider/container.py | 2 -- dangerzone/isolation_provider/dummy.py | 2 +- dev_scripts/pytest-wrapper.py | 1 - dev_scripts/qa.py | 7 ------- 7 files changed, 1 insertion(+), 14 deletions(-) diff --git a/container/dangerzone.py b/container/dangerzone.py index 2623ee6..f69529b 100644 --- a/container/dangerzone.py +++ b/container/dangerzone.py @@ -133,7 +133,6 @@ class DangerzoneConverter: return timeout async def document_to_pixels(self) -> None: - conversions: Dict[str, Dict[str, Optional[str]]] = { # .pdf "application/pdf": {"type": None}, diff --git a/dangerzone/gui/logic.py b/dangerzone/gui/logic.py index 021cf2c..cf0c062 100644 --- a/dangerzone/gui/logic.py +++ b/dangerzone/gui/logic.py @@ -106,7 +106,6 @@ class DangerzoneGui(DangerzoneCore): for filename in os.listdir(search_path): full_filename = os.path.join(search_path, filename) if os.path.splitext(filename)[1] == ".desktop": - # See which ones can open PDFs desktop_entry = DesktopEntry(full_filename) if ( diff --git a/dangerzone/gui/main_window.py b/dangerzone/gui/main_window.py index 4844911..413779d 100644 --- a/dangerzone/gui/main_window.py +++ b/dangerzone/gui/main_window.py @@ -277,7 +277,6 @@ class ContentWidget(QtWidgets.QWidget): def documents_selected(self, new_docs: List[Document]) -> None: if not self.conversion_started: - # assumed all files in batch are in the same directory first_doc = new_docs[0] output_dir = os.path.dirname(first_doc.input_filename) diff --git a/dangerzone/isolation_provider/container.py b/dangerzone/isolation_provider/container.py index fb4e4a0..4113317 100644 --- a/dangerzone/isolation_provider/container.py +++ b/dangerzone/isolation_provider/container.py @@ -31,7 +31,6 @@ class NoContainerTechException(Exception): class Container(IsolationProvider): - # Name of the dangerzone container CONTAINER_NAME = "dangerzone.rocks/dangerzone" @@ -317,7 +316,6 @@ class Container(IsolationProvider): return success def get_max_parallel_conversions(self) -> int: - # FIXME hardcoded 1 until timeouts are more limited and better handled # https://github.com/freedomofpress/dangerzone/issues/257 return 1 diff --git a/dangerzone/isolation_provider/dummy.py b/dangerzone/isolation_provider/dummy.py index c2c6d66..b0ec822 100644 --- a/dangerzone/isolation_provider/dummy.py +++ b/dangerzone/isolation_provider/dummy.py @@ -56,7 +56,7 @@ class Dummy(IsolationProvider): [False, "Safe PDF created", 100.0], ] - for (error, text, percentage) in progress: + for error, text, percentage in progress: self.print_progress(document, error, text, percentage) # type: ignore [arg-type] if stdout_callback: stdout_callback(error, text, percentage) diff --git a/dev_scripts/pytest-wrapper.py b/dev_scripts/pytest-wrapper.py index d7aafc4..737cf45 100755 --- a/dev_scripts/pytest-wrapper.py +++ b/dev_scripts/pytest-wrapper.py @@ -48,7 +48,6 @@ def run_tests_in_sequence(pytest_args): if __name__ == "__main__": - pytest_args = sys.argv[1:] # exclude program names if Container.get_runtime_name() == "docker": diff --git a/dev_scripts/qa.py b/dev_scripts/qa.py index d06d03c..d470714 100755 --- a/dev_scripts/qa.py +++ b/dev_scripts/qa.py @@ -769,31 +769,26 @@ class QADebianBased(QALinux): class QADebianBullseye(QADebianBased): - DISTRO = "debian" VERSION = "bullseye" class QADebianBookworm(QADebianBased): - DISTRO = "debian" VERSION = "bookworm" class QAUbuntu2004(QADebianBased): - DISTRO = "ubuntu" VERSION = "20.04" class QAUbuntu2204(QADebianBased): - DISTRO = "ubuntu" VERSION = "22.04" class QAUbuntu2210(QADebianBased): - DISTRO = "ubuntu" VERSION = "22.10" @@ -816,12 +811,10 @@ class QAFedora(QALinux): class QAFedora36(QAFedora): - VERSION = "36" class QAFedora37(QAFedora): - VERSION = "37"