diff --git a/docs/gen_api_nav.py b/docs/gen_api_nav.py index 7b89f535..12707cf9 100644 --- a/docs/gen_api_nav.py +++ b/docs/gen_api_nav.py @@ -29,7 +29,7 @@ def main(): full_doc_path = full_doc_path.as_posix().replace("\\", "/") with mkdocs_gen_files.open(full_doc_path, "w") as fd: ident = ".".join(parts) - print(f"::: " + ident, file=fd) + print("::: " + ident, file=fd) mkdocs_gen_files.set_edit_path(full_doc_path, path.as_posix().replace("\\", "/")) diff --git a/docs/gen_examples.py b/docs/gen_examples.py index 04602901..078d156d 100644 --- a/docs/gen_examples.py +++ b/docs/gen_examples.py @@ -26,7 +26,7 @@ ) -class Examples(object): +class Examples(): def __init__(self, root: Path): self._root = root diff --git a/photoshop/api/_core.py b/photoshop/api/_core.py index f6c8a459..104c0413 100644 --- a/photoshop/api/_core.py +++ b/photoshop/api/_core.py @@ -15,7 +15,7 @@ from photoshop.api.errors import PhotoshopPythonAPIError -class Photoshop(object): +class Photoshop(): """Core API for all photoshop objects.""" _root = "Photoshop" diff --git a/photoshop/api/_document.py b/photoshop/api/_document.py index cb965510..4b275a84 100644 --- a/photoshop/api/_document.py +++ b/photoshop/api/_document.py @@ -161,7 +161,7 @@ def fullName(self): return Path(self.app.fullName) except COMError: self.eval_javascript( - 'alert ("Please save your Document first!",' '"{}")'.format(self.name), + f'alert ("Please save your Document first!","{self.name}")', ) @property @@ -237,7 +237,7 @@ def path(self) -> str: return Path(self.app.path) except COMError: self.eval_javascript( - 'alert ("Please save your Document first!",' '"{}")'.format(self.name), + f'alert ("Please save your Document first!","{self.name}")', ) @path.setter diff --git a/photoshop/api/_notifiers.py b/photoshop/api/_notifiers.py index 5878abb0..67823af1 100644 --- a/photoshop/api/_notifiers.py +++ b/photoshop/api/_notifiers.py @@ -27,7 +27,7 @@ def __init__(self, parent: Optional[Any] = None): @property def _notifiers(self) -> list: - return [n for n in self.app] + return list(self.app) def __len__(self): return self.length diff --git a/photoshop/api/_text_fonts.py b/photoshop/api/_text_fonts.py index 366a6c59..c8a6346f 100644 --- a/photoshop/api/_text_fonts.py +++ b/photoshop/api/_text_fonts.py @@ -16,7 +16,7 @@ def __iter__(self): @property def _fonts(self): - return [a for a in self.app] + return list(self.app) def __len__(self): return self.length diff --git a/photoshop/api/application.py b/photoshop/api/application.py index 681874dc..e15086cb 100644 --- a/photoshop/api/application.py +++ b/photoshop/api/application.py @@ -290,10 +290,7 @@ def doAction(self, action, action_from="Default Actions"): return True def doForcedProgress(self, title, javascript): - script = "app.doForcedProgress('{}', '{}')".format( - title, - javascript, - ) + script = f"app.doForcedProgress('{title}', '{javascript}')" self.eval_javascript(script) # Ensure the script execute success. time.sleep(1) @@ -307,10 +304,7 @@ def doProgress(self, title, javascript): javascript (str): JavaScriptString to execute. """ - script = "app.doProgress('{}', '{}')".format( - title, - javascript, - ) + script = f"app.doProgress('{title}', '{javascript}')" self.eval_javascript(script) # Ensure the script execute success. time.sleep(1) @@ -327,11 +321,7 @@ def doProgressSegmentTask(self, segmentLength, done, total, javascript): time.sleep(1) def doProgressSubTask(self, index, limit, javascript): - script = "app.doProgressSubTask({}, {}, '{}');".format( - index, - limit, - javascript, - ) + script = f"app.doProgressSubTask({index}, {limit}, '{javascript}');" self.eval_javascript(script) # Ensure the script execute success. time.sleep(1) diff --git a/test/test_imports.py b/test/test_imports.py index 1888151f..4e145041 100644 --- a/test/test_imports.py +++ b/test/test_imports.py @@ -15,7 +15,7 @@ def test_imports(): """Test import modules.""" - prefix = "{}.".format(photoshop.__name__) + prefix = f"{photoshop.__name__}." iter_packages = pkgutil.walk_packages( photoshop.__path__, # noqa: WPS609 prefix,