diff options
author | Philipp Hörist <philipp@hoerist.com> | 2023-05-28 22:30:32 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2023-05-28 22:30:32 +0300 |
commit | af4223a99c11ac696f2bcd96b9567b6b92cf2c62 (patch) | |
tree | d511781de7ba5dc8eb2514fdfc59ee0f20b93c8f | |
parent | 5a9362fd275e36ca931d4936eb7c40209741759b (diff) |
cq: Use f-string instead of `format` call
-rw-r--r-- | gajim/gtk/certificate_dialog.py | 2 | ||||
-rw-r--r-- | gajim/plugins/pluginmanager.py | 2 | ||||
-rwxr-xr-x | mac/makebundle.py | 2 | ||||
-rwxr-xr-x | mac/makeicns.py | 4 | ||||
-rw-r--r-- | pyproject.toml | 1 |
5 files changed, 5 insertions, 6 deletions
diff --git a/gajim/gtk/certificate_dialog.py b/gajim/gtk/certificate_dialog.py index 2f451f61e..008d20268 100644 --- a/gajim/gtk/certificate_dialog.py +++ b/gajim/gtk/certificate_dialog.py @@ -91,7 +91,7 @@ class CertificateBox(Gtk.Box): subject_ext.value.get_values_for_type(DNSName)) # pyright: ignore self._it_subject_alt_names = '\n'.join(alt_names) - serial_str = '0{:02X}'.format(cert.serial_number) + serial_str = f'{cert.serial_number:02X}' serial_str_foratted = ':'.join( map('{}{}'.format, *(serial_str[::2], serial_str[1::2]))) self._it_serial_number = serial_str_foratted diff --git a/gajim/plugins/pluginmanager.py b/gajim/plugins/pluginmanager.py index 135155f83..796618b5b 100644 --- a/gajim/plugins/pluginmanager.py +++ b/gajim/plugins/pluginmanager.py @@ -233,7 +233,7 @@ class PluginManager(metaclass=Singleton): # name to avoid name problems (removing module_abc if base_package is # module_ab) modules_to_remove = [module for module in sys.modules - if module.startswith('{}.'.format(base_package))] + if module.startswith(f'{base_package}.')] # remove the base_package itself if base_package in sys.modules: modules_to_remove.append(base_package) diff --git a/mac/makebundle.py b/mac/makebundle.py index 87110edb0..299e5b2f5 100755 --- a/mac/makebundle.py +++ b/mac/makebundle.py @@ -25,7 +25,7 @@ if __name__ == '__main__': version = version.decode().strip() except CalledProcessError: version = 'unknown' - dmg_name = 'gajim-{}.dmg'.format(version) + dmg_name = f'gajim-{version}.dmg' # the .spec has to be in the project root run(['cp', 'mac/gajim.spec', 'gajim.spec'], check=True) diff --git a/mac/makeicns.py b/mac/makeicns.py index cadc5b6ee..20cafe1a6 100755 --- a/mac/makeicns.py +++ b/mac/makeicns.py @@ -16,8 +16,8 @@ def create_icns(icon_path: str) -> None: for size_pt in [16, 32, 128, 256, 512]: for scale in [1, 2]: size_px = scale * size_pt - scale_txt = '@{}'.format(scale) if scale != 1 else '' - png_fn = 'icon_{}x{}{}.png'.format(size_pt, size_pt, scale_txt) + scale_txt = f'@{scale}' if scale != 1 else '' + png_fn = f'icon_{size_pt}x{size_pt}{scale_txt}.png' png_path = os.path.join(tmpdir, png_fn) run(['inkscape', '-z', '-e', png_path, '-w', str(size_px), '-h', str(size_px), '-y', '0', diff --git a/pyproject.toml b/pyproject.toml index 5444ed27c..9a5dd5495 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -233,7 +233,6 @@ ignore = [ "SIM201", # Use x instead of not x "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 "UP037", # Remove quotes from type annotation ] |