Skip to content

Commit

Permalink
<API Update>[optional scope]: <Update for new sequence diagrams>
Browse files Browse the repository at this point in the history
[
]

[
#58
#59
]
  • Loading branch information
hasii2011 committed Dec 8, 2024
1 parent 57558ea commit 00e6e54
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 28 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
19 changes: 8 additions & 11 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions src/oglio/Types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion src/oglio/Writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down
2 changes: 1 addition & 1 deletion src/oglio/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__: str = '2.3.1'
__version__: str = '2.3.2'
3 changes: 2 additions & 1 deletion src/oglio/toXmlV10/BaseOglToDom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions src/oglio/toXmlV10/OglSequenceToDom.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 13 additions & 4 deletions src/oglio/toXmlV11/OglSequenceToXml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions tests/oglio/toXmlV11/TestOglToXmlV11.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 00e6e54

Please sign in to comment.