Skip to content

Commit

Permalink
<Modernize>[]: <Fix deprecated Methods>
Browse files Browse the repository at this point in the history
[]

[#21]
  • Loading branch information
Humberto Sanchez II committed Feb 22, 2023
1 parent 0ee8af6 commit 5ea3d56
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions oglio/toXmlV10/OglLinksToDom.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from xml.dom.minidom import Document
from xml.dom.minidom import Element

from miniogl.AttachmentLocation import AttachmentLocation
from miniogl.AttachmentSide import AttachmentSide
from miniogl.SelectAnchorPoint import SelectAnchorPoint

from ogl.OglAssociation import OglAssociation
Expand Down Expand Up @@ -53,7 +53,7 @@ def _oglInterface2ToDom(self, oglInterface: OglInterface2, xmlDoc: Document) ->
root: Element = xmlDoc.createElement(XmlConstants.ELEMENT_GRAPHIC_LOLLIPOP)

destAnchor: SelectAnchorPoint = oglInterface.destinationAnchor
attachmentPoint: AttachmentLocation = destAnchor.attachmentPoint
attachmentPoint: AttachmentSide = destAnchor.attachmentPoint
x, y = destAnchor.GetPosition()

root.setAttribute(XmlConstants.ATTR_LOLLIPOP_ATTACHMENT_POINT, attachmentPoint.__str__())
Expand Down Expand Up @@ -82,12 +82,12 @@ def _oglLinkToDom(self, oglLink: OglLink, xmlDoc: Document):
root = xmlDoc.createElement(XmlConstants.ELEMENT_GRAPHIC_LINK)

# save source and destination anchor points
x, y = oglLink.GetSource().GetModel().GetPosition()
x, y = oglLink.sourceAnchor.GetModel().GetPosition()
simpleX, simpleY = self._getSimpleCoordinates(x, y)
root.setAttribute(XmlConstants.ATTR_LINK_SOURCE_ANCHOR_X, simpleX)
root.setAttribute(XmlConstants.ATTR_LINK_SOURCE_ANCHOR_Y, simpleY)

x, y = oglLink.GetDestination().GetModel().GetPosition()
x, y = oglLink.destinationAnchor.GetModel().GetPosition()
simpleX, simpleY = self._getSimpleCoordinates(x, y)

root.setAttribute(XmlConstants.ATTR_LINK_DESTINATION_ANCHOR_X, simpleX)
Expand Down

0 comments on commit 5ea3d56

Please sign in to comment.