]> kaliko git repositories - python-musicpd.git/commitdiff
f-string conversion
authorKaliko Jack <kaliko@azylum.org>
Sun, 4 Feb 2024 16:38:49 +0000 (17:38 +0100)
committerKaliko Jack <kaliko@azylum.org>
Sun, 4 Feb 2024 16:38:49 +0000 (17:38 +0100)
musicpd.py

index e61188da533b6133acdca63d4e7f17f6e0502aac..8b5d789ad86d291c85633415e3f3547d582d1fab 100644 (file)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# SPDX-FileCopyrightText: 2012-2023  kaliko <kaliko@azylum.org>
+# SPDX-FileCopyrightText: 2012-2024  kaliko <kaliko@azylum.org>
 # SPDX-FileCopyrightText: 2021       Wonko der Verständige <wonko@hanstool.org>
 # SPDX-FileCopyrightText: 2019       Naglis Jonaitis <naglis@mailbox.org>
 # SPDX-FileCopyrightText: 2019       Bart Van Loon <bbb@bbbart.be>
@@ -436,9 +436,9 @@ class MPDClient:
         parts = [command]
         for arg in args:
             if isinstance(arg, tuple):
-                parts.append('{0!s}'.format(Range(arg)))
+                parts.append(f'{Range(arg)!s}')
             else:
-                parts.append('"%s"' % escape(str(arg)))
+                parts.append(f'"{escape(str(arg))}"')
         if '\n' in ' '.join(parts):
             raise CommandError('new line found in the command!')
         self._write_line(" ".join(parts))