From 4d0db614df83e93af6e5ef170229c5e0e3845970 Mon Sep 17 00:00:00 2001 From: "hao.long" Date: Sun, 10 May 2020 14:25:07 +0800 Subject: [PATCH] Clear up --- src/photoshop/__init__.py | 2 ++ src/photoshop/api/_text_fonts.py | 3 +++ src/photoshop/api/application.py | 3 ++- src/photoshop/api/save_options/eps.py | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/photoshop/__init__.py b/src/photoshop/__init__.py index 95a04140..275f2da6 100644 --- a/src/photoshop/__init__.py +++ b/src/photoshop/__init__.py @@ -1,5 +1,7 @@ from photoshop.session import Session +__all__ = ["Session"] + __title__ = "photoshop_python_api" __version__ = "0.12.0" __author__ = "Long Hao" diff --git a/src/photoshop/api/_text_fonts.py b/src/photoshop/api/_text_fonts.py index 59fe2c44..1168416c 100644 --- a/src/photoshop/api/_text_fonts.py +++ b/src/photoshop/api/_text_fonts.py @@ -1,5 +1,6 @@ from ._core import Photoshop from .text_font import TextFont +from .errors import PhotoshopPythonAPIError class TextFonts(Photoshop): @@ -36,3 +37,5 @@ def getByName(self, name): for font in self.app: if font.name == name: return TextFont(font) + raise PhotoshopPythonAPIError("Could not find a TextFont named " + f'"{name}"') diff --git a/src/photoshop/api/application.py b/src/photoshop/api/application.py index 5e2c9b9c..d577febb 100644 --- a/src/photoshop/api/application.py +++ b/src/photoshop/api/application.py @@ -280,7 +280,8 @@ def changeProgressText(self, text): def charIDToTypeID(self, char_id): return self.app.charIDToTypeID(char_id) - def compareWithNumbers(self, first, second): + @staticmethod + def compareWithNumbers(first, second): return first > second def doAction(self, action, action_from): diff --git a/src/photoshop/api/save_options/eps.py b/src/photoshop/api/save_options/eps.py index b309c208..51f6bddc 100644 --- a/src/photoshop/api/save_options/eps.py +++ b/src/photoshop/api/save_options/eps.py @@ -1,5 +1,5 @@ # Import local modules -from photoshop._core import Photoshop +from .._core import Photoshop class EPSSaveOptions(Photoshop):