From 77e7258c69f1e66d331cc0ef185a69056a161417 Mon Sep 17 00:00:00 2001 From: Humberto Sanchez II Date: Wed, 17 Jan 2024 13:09:12 -0600 Subject: [PATCH] [optional scope]: [ * V3 does not invoke __init__ * Cleanup some English * Cleanup unused constant * Make module less dependent on codeallyXXX variants ] [https://github.com/hasii2011/ogl/issues/101] --- .circleci/config.yml | 4 ++-- pyproject.toml | 4 ++-- requirements.txt | 6 +++--- src/ogl/OglLinkFactory.py | 12 ++++++------ src/ogl/_version.py | 2 +- src/ogl/preferences/OglPreferences.py | 5 ++--- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3182cd8..effeb5c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,8 +35,8 @@ jobs: pip install attrdict3 pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04 wxPython pip install Deprecated~=1.2.14 - pip install codeallybasic==1.0.0 - pip install codeallyadvanced==1.0.0 + pip install codeallybasic==1.1.0 + pip install codeallyadvanced==1.1.0 pip install pyutmodelv2==2.1.0 - run: name: run tests diff --git a/pyproject.toml b/pyproject.toml index 9324078..ea4dea2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,8 +14,8 @@ keywords = ['pyut', 'graphical shapes', 'python',] dependencies = [ 'wxPython~=4.2.1', - 'codeallybasic==1.0.0', - 'codeallyadvanced==1.0.0', + 'codeallybasic>=1.1.0', + 'codeallyadvanced>=1.1.0', 'pyutmodelv2==2.1.0', ] diff --git a/requirements.txt b/requirements.txt index 01f28dd..322a654 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,12 +10,12 @@ buildlackey==1.6.3 mypy==1.8.0 mypy-extensions==1.0.0 types-Deprecated==1.2.9.20240106 -types-setuptools==69.0.0.20240106 +types-setuptools==69.0.0.20240115 typing_extensions==4.9.0 Deprecated==1.2.14 pyutmodelv2==2.1.0 -codeallybasic==1.0.0 -codeallyadvanced==1.0.0 +codeallybasic==1.1.0 +codeallyadvanced==1.1.0 wxPython~=4.2.1 diff --git a/src/ogl/OglLinkFactory.py b/src/ogl/OglLinkFactory.py index 9bc0c0c..367db70 100644 --- a/src/ogl/OglLinkFactory.py +++ b/src/ogl/OglLinkFactory.py @@ -2,7 +2,7 @@ from logging import Logger from logging import getLogger -from codeallybasic.Singleton import Singleton +from codeallybasic.SingletonV3 import SingletonV3 from pyutmodelv2.enumerations.PyutLinkType import PyutLinkType @@ -47,19 +47,19 @@ def getLinkType(link: OglAssociation) -> PyutLinkType: return PyutLinkType.NOTELINK -class OglLinkFactory(Singleton): +class OglLinkFactory(metaclass=SingletonV3): """ This class is a factory to produce `OglLink` objects. It works under the Factory Design Pattern model. Ask for a link - from this object, and it will return you what you was asking for. + from this object, and it will return an instance of request link. """ - def init(self, *args, **kwargs): - # noinspection PyAttributeOutsideInit + def __init__(self): + self.logger: Logger = getLogger(__name__) def getOglLink(self, srcShape, pyutLink, destShape, linkType: PyutLinkType): """ - Used to get a OglLink of the given linkType. + Used to get an OglLink of the given linkType. Args: srcShape: Source shape diff --git a/src/ogl/_version.py b/src/ogl/_version.py index a33997d..cfb007c 100644 --- a/src/ogl/_version.py +++ b/src/ogl/_version.py @@ -1 +1 @@ -__version__ = '2.1.0' +__version__ = '2.1.5' diff --git a/src/ogl/preferences/OglPreferences.py b/src/ogl/preferences/OglPreferences.py index f562e7d..76550e0 100644 --- a/src/ogl/preferences/OglPreferences.py +++ b/src/ogl/preferences/OglPreferences.py @@ -8,7 +8,7 @@ from configparser import ConfigParser -from codeallybasic.SingletonV2 import SingletonV2 +from codeallybasic.SingletonV3 import SingletonV3 from codeallybasic.ConfigurationLocator import ConfigurationLocator from miniogl.MiniOglColorEnum import MiniOglColorEnum @@ -20,11 +20,10 @@ OGL_PREFS_NAME_VALUES = Dict[str, str] -class OglPreferences(SingletonV2): +class OglPreferences(metaclass=SingletonV3): MODULE_NAME: str = 'ogl' PREFERENCES_FILENAME: str = f'{MODULE_NAME}.ini' - THE_GREAT_MAC_PLATFORM: str = 'darwin' SECTION_OGL_PREFERENCES: str = 'Ogl' SECTION_DIAGRAM: str = 'Diagram'