Skip to content

Commit

Permalink
<Update>[]: <Update string representations>
Browse files Browse the repository at this point in the history
[
Need these for Pyut logging
]

[#125]
hasii2011 committed Jan 23, 2025
1 parent 1a5dfcb commit 6b17384
Showing 8 changed files with 27 additions and 6 deletions.
5 changes: 4 additions & 1 deletion src/ogl/OglAggregation.py
Original file line number Diff line number Diff line change
@@ -41,6 +41,9 @@ def Draw(self, dc: DC, withChildren: bool = False):
# Draw diamond
self.drawDiamond(dc, False)

def __repr__(self):
def __str__(self) -> str:
return self.__repr__()

def __repr__(self) -> str:
from ogl.OglLink import OglLink
return f'OglAggregation - {OglLink.__repr__(self)}'
5 changes: 4 additions & 1 deletion src/ogl/OglAssociation.py
Original file line number Diff line number Diff line change
@@ -346,5 +346,8 @@ def calculateDiamondPoint3(cls, x2: float, y2: float, alpha: float) -> DiamondPo

return DiamondPoint((round(dpx3), round(dpy3)))

def __repr__(self):
def __str__(self) -> str:
return self.__repr__()

def __repr__(self) -> str:
return f'OglAssociation - {super().__repr__()}'
5 changes: 4 additions & 1 deletion src/ogl/OglComposition.py
Original file line number Diff line number Diff line change
@@ -38,6 +38,9 @@ def Draw(self, dc: DC, withChildren: bool = False):
super().Draw(dc, withChildren=withChildren)
self.drawDiamond(dc, True)

def __repr__(self):
def __str__(self) -> str:
return self.__repr__()

def __repr__(self) -> str:
from ogl.OglLink import OglLink
return f'OglComposition - {OglLink.__repr__(self)}'
3 changes: 3 additions & 0 deletions src/ogl/OglInheritance.py
Original file line number Diff line number Diff line change
@@ -35,6 +35,9 @@ def __init__(self, srcShape: OglClass, pyutLink: PyutLink, dstShape: OglClass, s
self.brush = WHITE_BRUSH
self.drawArrow = True

def __str__(self) -> str:
return self.__repr__()

def __repr__(self):
srcShape: Shape = self.sourceShape
dstShape: Shape = self.destinationShape
3 changes: 3 additions & 0 deletions src/ogl/OglNote.py
Original file line number Diff line number Diff line change
@@ -91,6 +91,9 @@ def Draw(self, dc: DC, withChildren: bool = False):

dc.DestroyClippingRegion()

def __str__(self) -> str:
return f'OglNote - modelId: {self._pyutObject.id}'

def __repr__(self):
pyutNote: PyutNote = cast(PyutNote, self.pyutObject)
if pyutNote is None:
5 changes: 4 additions & 1 deletion src/ogl/OglNoteLink.py
Original file line number Diff line number Diff line change
@@ -31,7 +31,10 @@ def __init__(self, srcShape: OglObject, pyutLink: PyutLink, dstShape: OglObject)
self.drawArrow = False
self.pen = Pen("BLACK", 1, PENSTYLE_LONG_DASH)

def __repr__(self):
def __str__(self) -> str:
return self.__repr__()

def __repr__(self) -> str:

srcShape: Shape = self.sourceShape
destShape: Shape = self.destinationShape
5 changes: 4 additions & 1 deletion src/ogl/OglText.py
Original file line number Diff line number Diff line change
@@ -284,7 +284,10 @@ def __initializeTextDisplay(self):
self._textFont.SetPointSize(self.textSize)
self._textFont.SetFamily(OglUtils.oglFontFamilyToWxFontFamily(self.textFontFamily))

def __str__(self) -> str:
return f'OglText - modelId: `{self._pyutObject.id}`'

def __repr__(self):

strMe: str = f"[OglText - name: '{self._pyutObject.name}' id: '{self._pyutObject.id}']"
strMe: str = f"[OglText modelId: '{self._pyutObject.id}']"
return strMe
2 changes: 1 addition & 1 deletion src/ogl/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '3.6.3'
__version__ = '3.6.4'

0 comments on commit 6b17384

Please sign in to comment.