diff --git a/.circleci/config.yml b/.circleci/config.yml index 71d4a9e..a9db0dc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -33,11 +33,11 @@ jobs: pip install html-testRunner~=1.2.1 pip install attrdict3~=2.0.2 pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-22.04 wxPython - pip install codeallybasic==1.3.2 - pip install codeallyadvanced==1.3.1 + pip install codeallybasic==1.7.0 + pip install codeallyadvanced==1.3.2 pip install pyutmodelv2>=2.1.6 - pip install ogl>=2.3.0 - pip install untanglepyut>=2.3.0 + pip install ogl>=3.5.0 + pip install untanglepyut>=2.6.0 pip install buildlackey~=1.6.3 - run: name: run tests diff --git a/pyproject.toml b/pyproject.toml index 436b4f0..fc68f3b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,8 +17,8 @@ dependencies = [ 'codeallybasic>=1.7.0', 'codeallyadvanced>=1.3.2', 'pyutmodelv2>=2.2.0', - 'ogl>=3.1.0', - 'untanglepyut>=2.4.0', + 'ogl>=3.5.0', + 'untanglepyut>=2.6.0', ] [project.urls] diff --git a/requirements.txt b/requirements.txt index e6ca1a4..de6c40d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,19 +1,16 @@ -wheel==0.44.0 -setuptools==75.2.0 -twine==5.1.1 +wheel==0.45.1 +setuptools==75.6.0 +twine==6.0.1 build==1.2.2.post1 html-testRunner~=1.2.1 buildlackey==1.7.0 mypy==1.13.0 -# mypy-extensions==1.0.0 -# typing_extensions==4.12.2 -# types-setuptools==70.1.0.20240627 -wxPython~=4.2.1 +wxPython>=4.2.2 -codeallybasic==1.7.0 -codeallyadvanced==1.3.2 +codeallybasic>=1.7.0 +codeallyadvanced>=1.3.2 pyutmodelv2==2.2.0 -ogl>=3.1.0 -untanglepyut>=2.4.0 +ogl>=3.5.0 +untanglepyut>=2.6.0 diff --git a/src/oglio/Types.py b/src/oglio/Types.py index 86733b9..4c25d2d 100644 --- a/src/oglio/Types.py +++ b/src/oglio/Types.py @@ -13,6 +13,7 @@ from ogl.OglLink import OglLink from ogl.OglText import OglText from ogl.OglUseCase import OglUseCase + from ogl.sd.OglSDInstance import OglSDInstance from ogl.sd.OglSDMessage import OglSDMessage @@ -25,8 +26,9 @@ OglTexts = NewType('OglTexts', List[OglText]) OglActors = NewType('OglActors', List[OglActor]) OglUseCases = NewType('OglUseCases', List[OglUseCase]) -OglSDInstances = NewType('OglSDInstances', Dict[int, OglSDInstance]) -OglSDMessages = NewType('OglSDMessages', Dict[int, OglSDMessage]) + +OglSDInstances = NewType('OglSDInstances', Dict[int, OglSDInstance]) +OglSDMessages = NewType('OglSDMessages', Dict[int, OglSDMessage]) OglObjects = Union[OglClasses, OglLinks, OglNotes, OglTexts, OglActors, OglUseCases] diff --git a/src/oglio/Writer.py b/src/oglio/Writer.py index 5f1c5ec..d761200 100644 --- a/src/oglio/Writer.py +++ b/src/oglio/Writer.py @@ -15,7 +15,7 @@ class Writer: A shim on top of the OGL serialization layer; Allowed me to replace the heavy-duty Python core xml minidom implementation - with Python Xml Elment Tree + with Python Xml Element Tree The write only writes the latest XML version """ diff --git a/src/oglio/_version.py b/src/oglio/_version.py index c73b976..ed4a73b 100644 --- a/src/oglio/_version.py +++ b/src/oglio/_version.py @@ -1 +1 @@ -__version__: str = '2.3.1' +__version__: str = '2.3.2' diff --git a/src/oglio/toXmlV10/BaseOglToDom.py b/src/oglio/toXmlV10/BaseOglToDom.py index c894d9b..98512b5 100644 --- a/src/oglio/toXmlV10/BaseOglToDom.py +++ b/src/oglio/toXmlV10/BaseOglToDom.py @@ -33,7 +33,8 @@ def _appendOglBase(self, oglObject: OglObject, root: Element) -> Element: The updated element """ # Saving size - w, h = oglObject.model.GetSize() + # w, h = oglObject.model.GetSize() + w, h = oglObject.GetSize() simpleW, simpleH = self._getSimpleDimensions(w, h) root.setAttribute(XmlConstants.ATTR_WIDTH, simpleW) root.setAttribute(XmlConstants.ATTR_HEIGHT, simpleH) diff --git a/src/oglio/toXmlV10/OglSequenceToDom.py b/src/oglio/toXmlV10/OglSequenceToDom.py index 2b0ce3d..9b0eabb 100644 --- a/src/oglio/toXmlV10/OglSequenceToDom.py +++ b/src/oglio/toXmlV10/OglSequenceToDom.py @@ -54,9 +54,10 @@ def _oglSDInstanceToDom(self, oglSDInstance: OglSDInstance, xmlDoc: Document) -> """ root: Element = self._xmlDocument.createElement(XmlConstants.ELEMENT_GRAPHIC_SD_INSTANCE) - self._appendOglBase(oglSDInstance, root) + # noinspection PyTypeChecker + self._appendOglBase(oglSDInstance, root) # type: ignore - root.appendChild(self._pyutToMiniDom.pyutSDInstanceToDom(cast(PyutSDInstance, oglSDInstance.pyutObject), xmlDoc)) + root.appendChild(self._pyutToMiniDom.pyutSDInstanceToDom(cast(PyutSDInstance, oglSDInstance.pyutSDInstance), xmlDoc)) return root diff --git a/src/oglio/toXmlV11/OglSequenceToXml.py b/src/oglio/toXmlV11/OglSequenceToXml.py index 77a7a53..cd9407a 100644 --- a/src/oglio/toXmlV11/OglSequenceToXml.py +++ b/src/oglio/toXmlV11/OglSequenceToXml.py @@ -12,8 +12,8 @@ from oglio.Types import OglSDInstances from oglio.Types import OglSDMessages -from oglio.toXmlV11.InternalTypes import ElementAttributes +from oglio.toXmlV11.InternalTypes import ElementAttributes from oglio.toXmlV11.XmlConstants import XmlConstants from oglio.toXmlV11.BaseOglToXml import BaseOglToXml from oglio.toXmlV11.PyutToXml import PyutToXml @@ -36,7 +36,7 @@ def serialize(self, documentTop: Element, oglSDMessages: OglSDMessages, oglSDIns return documentTop - def _oglSDInstanceToXml(self, documentTop: Element, oglSDInstance: OglSDInstance,) -> Element: + def _oglSDInstanceToXml(self, documentTop: Element, oglSDInstance: OglSDInstance, ) -> Element: """ Export an OglSDInstance to a minidom Element @@ -47,10 +47,19 @@ def _oglSDInstanceToXml(self, documentTop: Element, oglSDInstance: OglSDInstanc Returns: An element """ - attributes: ElementAttributes = self._oglBaseAttributes(oglObject=oglSDInstance) + w, h = oglSDInstance.GetSize() + x, y = oglSDInstance.GetPosition() + + attributes: ElementAttributes = ElementAttributes({ + XmlConstants.ATTR_WIDTH: str(w), + XmlConstants.ATTR_HEIGHT: str(h), + XmlConstants.ATTR_X: str(x), + XmlConstants.ATTR_Y: str(y), + }) + oglSDInstanceElement: Element = SubElement(documentTop, XmlConstants.ELEMENT_OGL_SD_INSTANCE, attrib=attributes) - self._pyutToXml.pyutSDInstanceToXml(pyutSDInstance=oglSDInstance.pyutObject, oglSDInstanceElement=oglSDInstanceElement) + self._pyutToXml.pyutSDInstanceToXml(pyutSDInstance=oglSDInstance.pyutSDInstance, oglSDInstanceElement=oglSDInstanceElement) return oglSDInstanceElement diff --git a/tests/oglio/toXmlV11/TestOglToXmlV11.py b/tests/oglio/toXmlV11/TestOglToXmlV11.py index 4e4d646..9eb8887 100644 --- a/tests/oglio/toXmlV11/TestOglToXmlV11.py +++ b/tests/oglio/toXmlV11/TestOglToXmlV11.py @@ -19,6 +19,7 @@ from oglio.Types import OglTexts from oglio.Types import OglUseCases from oglio.toXmlV11.OglToXml import OglToXml + from tests.ProjectTestBase import ProjectTestBase EMPTY_DOCUMENT_FILENAME: str = 'EmptyDocument.xml'