diff options
author | Philipp Hörist <philipp@hoerist.com> | 2023-05-28 22:19:39 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2023-05-28 22:19:39 +0300 |
commit | a4cacbfa7c2c294c4cf964bea4a80d2af368f102 (patch) | |
tree | 70aa9c2e46822ce5b4a26c12d86def5f18139c46 | |
parent | 173d6f78e903bda15daed08d40c535b8cb026d0f (diff) |
cq: Avoid extraneous parentheses
-rw-r--r-- | gajim/common/preview_helpers.py | 4 | ||||
-rw-r--r-- | gajim/gtk/filetransfer.py | 2 | ||||
-rw-r--r-- | gajim/gtk/util.py | 4 | ||||
-rw-r--r-- | pyproject.toml | 1 |
4 files changed, 5 insertions, 6 deletions
diff --git a/gajim/common/preview_helpers.py b/gajim/common/preview_helpers.py index 443967d1e..310325811 100644 --- a/gajim/common/preview_helpers.py +++ b/gajim/common/preview_helpers.py @@ -255,11 +255,11 @@ def get_thumbnail_size(pixbuf: GdkPixbuf.Pixbuf, size: int) -> tuple[int, int]: if image_width > image_height: if image_width > size: - image_height = math.ceil((size / float(image_width) * image_height)) + image_height = math.ceil(size / float(image_width) * image_height) image_width = int(size) else: if image_height > size: - image_width = math.ceil((size / float(image_height) * image_width)) + image_width = math.ceil(size / float(image_height) * image_width) image_height = int(size) return image_width, image_height diff --git a/gajim/gtk/filetransfer.py b/gajim/gtk/filetransfer.py index 6b1a9533c..d3c7ab012 100644 --- a/gajim/gtk/filetransfer.py +++ b/gajim/gtk/filetransfer.py @@ -879,7 +879,7 @@ class FileTransfersWindow: def _on_cleanup_button_clicked(self, widget): i = len(self.model) - 1 while i >= 0: - iter_ = self.model.get_iter((i)) + iter_ = self.model.get_iter(i) sid = self.model[iter_][Column.SID] file_props = FilesProp.getFilePropByType(sid[0], sid[1:]) if is_transfer_stopped(file_props): diff --git a/gajim/gtk/util.py b/gajim/gtk/util.py index c3c6c8f81..7f42a34ce 100644 --- a/gajim/gtk/util.py +++ b/gajim/gtk/util.py @@ -649,12 +649,12 @@ def get_thumbnail_size(pixbuf: GdkPixbuf.Pixbuf, size: int) -> tuple[int, int]: if image_width > image_height: if image_width > size: image_height = math.ceil( - (size / float(image_width) * image_height)) + size / float(image_width) * image_height) image_width = int(size) else: if image_height > size: image_width = math.ceil( - (size / float(image_height) * image_width)) + size / float(image_height) * image_width) image_height = int(size) return image_width, image_height diff --git a/pyproject.toml b/pyproject.toml index 49f1079e6..806e05384 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -234,7 +234,6 @@ ignore = [ "SIM212", # Use `value if value else ''` instead of `'' if not value else value` "SIM300", # Yoda conditions are discouraged use x instead "UP032", # Use f-string instead of `format` call - "UP034", # Avoid extraneous parentheses "UP035", # Import from `collections.abc` instead: `Callable` "UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)` "UP037", # Remove quotes from type annotation |