Skip to content

Commit 1882c56

Browse files
committed
<API Update>[Ogl]: <description>
[ * Bump our version * Bump to new Ogl Version * Don't use pyutObject, use pyutSDInstance ] [#83]
1 parent 18682f7 commit 1882c56

File tree

6 files changed

+14
-27
lines changed

6 files changed

+14
-27
lines changed

requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ html-testRunner~=1.2.1
77
buildlackey==1.7.0
88

99
mypy==1.13.0
10+
mypy-extensions>=1.0.0
11+
typing_extensions==4.12.2
1012

1113
untangle==1.2.1
1214
wxPython==4.2.2
@@ -15,4 +17,4 @@ codeallybasic>=1.7.0
1517
codeallyadvanced>=1.3.2
1618

1719
pyutmodelv2==2.2.0
18-
ogl>=3.1.0
20+
ogl>=3.5.0

src/untanglepyut/BaseUnTangle.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from miniogl.models.ShapeModel import ShapeModel
66

77
from ogl.OglObject import OglObject
8+
from ogl.sd.OglSDInstance import OglSDInstance
89

910
from untanglepyut.Types import GraphicInformation
1011

@@ -20,7 +21,7 @@ def __init__(self, xmlVersion: XmlVersion):
2021

2122
self._xmlVersion = xmlVersion
2223

23-
def _updateModel(self, oglObject: OglObject, graphicInformation: GraphicInformation) -> ShapeModel:
24+
def _updateModel(self, oglObject: OglObject | OglSDInstance, graphicInformation: GraphicInformation) -> ShapeModel:
2425
"""
2526
This is necessary if it is never added to a diagram
2627
and immediately serialized

src/untanglepyut/UnTangleSequenceDiagram.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,11 @@ def _untangleSDMessages(self, pyutDocument: Element) -> OglSDMessages:
9595
srcInstance: OglSDInstance = self._oglSDInstances[bogus.sourceId]
9696
dstInstance: OglSDInstance = self._oglSDInstances[bogus.destinationId]
9797

98-
# pyutSDMessage.setSource(srcInstance.pyutObject) # Ugh, time was set by sdMessageToPyutSDMessage
99-
# pyutSDMessage.setDestination(dstInstance.pyutObject) # This "split" functionality must be fixed
100-
pyutSDMessage.source = srcInstance.pyutObject # Ugh, time was set by sdMessageToPyutSDMessage
101-
pyutSDMessage.destination = dstInstance.pyutObject # This "split" functionality must be fixed
98+
pyutSDMessage.source = srcInstance.pyutSDInstance # Ugh, time was set by sdMessageToPyutSDMessage
99+
pyutSDMessage.destination = dstInstance.pyutSDInstance # This "split" functionality must be fixed
102100

103101
oglSDMessage: OglSDMessage = OglSDMessage(srcSDInstance=srcInstance, pyutSDMessage=pyutSDMessage, dstSDInstance=dstInstance)
104102

105-
# This is done by the constructor above
106-
# srcInstance.addLink(link=oglSDMessage)
107-
# dstInstance.addLink(link=oglSDMessage)
108-
109103
oglSDMessages[pyutSDMessage.id] = oglSDMessage
110104

111105
return oglSDMessages

src/untanglepyut/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__: str = '2.5.0'
1+
__version__: str = '2.6.0'

tests/untanglepyut/v10/TestUnTangleSequenceDiagram.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,6 @@ def testSimpleSequenceDiagram(self):
4141
document: Document = self._retrieveSequenceDiagramDocument()
4242
self.assertEqual('SEQUENCE_DIAGRAM', document.documentType, 'Incorrect document type')
4343

44-
def testSequenceInstances(self):
45-
document: Document = self._retrieveSequenceDiagramDocument()
46-
47-
oglSDInstances: OglSDInstances = document.oglSDInstances
48-
self.assertEqual(2, len(oglSDInstances), 'Bad # of instances')
49-
50-
expectedInstanceNames: List[str] = ['Instance1', 'Instance2']
51-
for oglSDInstance in oglSDInstances.values():
52-
self.assertIn(oglSDInstance.instanceName.text, expectedInstanceNames, 'Not an expected instance')
53-
5444
def testSequenceMessages(self):
5545
document: Document = self._retrieveSequenceDiagramDocument()
5646

tests/untanglepyut/v11/TestUnTangleSequenceDiagram.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ def testOglSdInstance(self):
8181

8282
oglSDInstance: OglSDInstance = oglSDInstances[3]
8383

84-
self.assertEqual('OzzeeInstance', oglSDInstance.pyutObject.instanceName, 'Incorrect instance name')
85-
self.assertEqual(200, oglSDInstance.pyutObject.instanceLifeLineLength, '')
84+
self.assertEqual('OzzeeInstance', oglSDInstance.pyutSDInstance.instanceName, 'Incorrect instance name')
85+
self.assertEqual(200, oglSDInstance.pyutSDInstance.instanceLifeLineLength, '')
8686

8787
def testOnlySingleLinksCreated(self):
8888

@@ -92,13 +92,13 @@ def testOnlySingleLinksCreated(self):
9292

9393
for sdInstance in oglSDInstances.values():
9494
oglSDInstance: OglSDInstance = cast(OglSDInstance, sdInstance)
95-
instanceName: str = oglSDInstance.pyutObject.instanceName
95+
instanceName: str = oglSDInstance.pyutSDInstance.instanceName
9696
if instanceName == 'hasiiInstance':
97-
self.assertEqual(1, len(oglSDInstance.links), f'`{instanceName}` Should have a single message')
97+
self.assertEqual(1, len(oglSDInstance.messages), f'`{instanceName}` Should have a single message')
9898
elif instanceName == 'franInstance':
99-
self.assertEqual(3, len(oglSDInstance.links), f'`{instanceName}` Should have a single message')
99+
self.assertEqual(3, len(oglSDInstance.messages), f'`{instanceName}` Should have a single message')
100100
elif instanceName == 'OzzeeInstance':
101-
self.assertEqual(2, len(oglSDInstance.links), f'`{instanceName}` Should have a single message')
101+
self.assertEqual(2, len(oglSDInstance.messages), f'`{instanceName}` Should have a single message')
102102

103103
def _untangleSequenceDiagramDocument(self) -> UnTangleSequenceDiagram:
104104

0 commit comments

Comments
 (0)