Skip to content

Commit

Permalink
<Update>[]: <Generate additional XML>
Browse files Browse the repository at this point in the history
[
* Only do V11
* Get new common type
* ]

[#53]
  • Loading branch information
Humberto Sanchez II committed Jan 15, 2024
1 parent 74bafa6 commit ff24210
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 65 deletions.
16 changes: 8 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ workflows:
jobs:
build:
docker:
- image: cimg/python:3.10-browsers
- image: cimg/python:3.11-browsers
executor: python/default
steps:
- checkout
Expand All @@ -33,13 +33,13 @@ 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==0.5.2
pip install codeallyadvanced==0.5.2
pip install pyutmodelv2~=2.0.0
pip install ogl~=2.0.0
pip install untanglepyut==2.0.0
pip install buildlackey~=1.6.2
pip install codeallybasic==1.0.0
pip install codeallyadvanced==1.0.0
pip install pyutmodelv2~=2.1.0
pip install ogl~=2.1.0
pip install untanglepyut==2.0.5
pip install buildlackey~=1.6.3
- run:
name: run tests
command: |
unittests -s .
unittests
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,37 @@

# Introduction
Provides a common way to parse and write Pyut XML files. Additionally, removes this code from
Pyut and places in a new project so we can easily version the library. Furthermore, allows
Pyut and places in a new project, so we can easily version the library. Furthermore, it allows
the development of an IOXml plugin for Pyut with common code

# Overview

___

## Developer Notes
This project uses [buildlackey](https://github.com/hasii2011/buildlackey) for day to day development builds
This project uses [buildlackey](https://github.com/hasii2011/buildlackey) for day-to-day development builds

___

## Note
For all kind of problems, requests, enhancements, bug reports, etc.,
For all kinds of problems, requests, enhancements, bug reports, etc.,
please drop me an e-mail.
Written by <a href="mailto:[email protected]@gmail.com?subject=Hello Humberto">Humberto A. Sanchez II</a> (C) 2023
Written by <a href="mailto:[email protected]@gmail.com?subject=Hello Humberto"> Humberto A. Sanchez II</a> (C) 2024


---
I am concerned about GitHub's Copilot project
I am concerned with the direction GitHub's Copilot project.

![](https://github.com/hasii2011/code-ally-basic/blob/master/developer/SillyGitHub.png)

I urge you to read about the
[Give up GitHub](https://GiveUpGitHub.org) campaign from
[the Software Freedom Conservancy](https://sfconservancy.org).

While I do not advocate for all the issues listed there I do not like that
While I do not advocate for all the issues listed there, I do not like that
a company like Microsoft may profit from open source projects.

I continue to use GitHub because it offers the services I need for free. But, I continue
to monitor their terms of service.
I continue to use GitHub because it offers the services I need for free.
But I continue to monitor their terms of service.

Any use of this project's code by GitHub Copilot, past or present, is done
without my permission. I do not consent to GitHub's use of this project's
code in Copilot.
I do not consent to any use of this project's code by the GitHub Copilot project it is done without my permission.
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ keywords = ['pyut', 'python', 'xml']

dependencies = [
'wxPython==4.2.1',
'codeallybasic==0.5.2',
'codeallyadvanced==0.5.2',
'pyutmodelv2==2.0.0',
'ogl==2.0.0',
'untanglepyut==2.0.0',
'codeallybasic==1.0.0',
'codeallyadvanced==1.0.0',
'pyutmodelv2==2.1.0',
'ogl==2.1.0',
'untanglepyut==2.0.5',
]

[project.urls]
Expand Down
18 changes: 9 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
wheel==0.42.0
setuptools==69.0.2
setuptools==69.0.3
twine==4.0.2
build==1.0.3
html-testRunner~=1.2.1
buildlackey==1.6.2
buildlackey==1.6.3

mypy==1.7.1
mypy==1.8.0
mypy-extensions==1.0.0
typing_extensions==4.9.0
types-setuptools==69.0.0.0
types-setuptools==69.0.0.20240106

wxPython~=4.2.1

codeallybasic==0.5.2
codeallyadvanced==0.5.2
pyutmodelv2==2.0.0
ogl==2.0.0
untanglepyut==2.0.0
codeallybasic==1.0.0
codeallyadvanced==1.0.0
pyutmodelv2==2.1.0
ogl==2.1.0
untanglepyut==2.0.5
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.0.0'
__version__: str = '2.1.0'
3 changes: 2 additions & 1 deletion src/oglio/toXmlV10/OglLinksToDom.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
from xml.dom.minidom import Document
from xml.dom.minidom import Element

from miniogl.AttachmentSide import AttachmentSide
from codeallyadvanced.ui.AttachmentSide import AttachmentSide

from miniogl.SelectAnchorPoint import SelectAnchorPoint

from ogl.OglAssociation import OglAssociation
Expand Down
4 changes: 3 additions & 1 deletion src/oglio/toXmlV11/OglLinksToXml.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
from xml.etree.ElementTree import Element
from xml.etree.ElementTree import SubElement

from miniogl.AttachmentSide import AttachmentSide
from codeallyadvanced.ui.AttachmentSide import AttachmentSide

from miniogl.SelectAnchorPoint import SelectAnchorPoint

from ogl.OglAssociation import OglAssociation
from ogl.OglAssociationLabel import OglAssociationLabel
from ogl.OglInterface2 import OglInterface2
Expand Down
18 changes: 10 additions & 8 deletions src/oglio/toXmlV11/PyutToXml.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,16 @@ def pyutClassToXml(self, pyutClass: PyutClass, graphicElement: Element) -> Eleme

commonAttributes = self._pyutClassCommonAttributes(pyutClass)
attributes = {
XmlConstants.ATTR_ID: str(pyutClass.id),
XmlConstants.ATTR_NAME: pyutClass.name,
XmlConstants.ATTR_STEREOTYPE: pyutClass.stereotype.value,
XmlConstants.ATTR_DISPLAY_METHODS: str(pyutClass.showMethods),
XmlConstants.ATTR_DISPLAY_PARAMETERS: str(pyutClass.displayParameters.value),
XmlConstants.ATTR_DISPLAY_FIELDS: str(pyutClass.showFields),
XmlConstants.ATTR_DISPLAY_STEREOTYPE: str(pyutClass.displayStereoType),
XmlConstants.ATTR_FILENAME: pyutClass.fileName,
XmlConstants.ATTR_ID: str(pyutClass.id),
XmlConstants.ATTR_NAME: pyutClass.name,
XmlConstants.ATTR_STEREOTYPE: pyutClass.stereotype.value,
XmlConstants.ATTR_DISPLAY_METHODS: str(pyutClass.showMethods),
XmlConstants.ATTR_DISPLAY_PARAMETERS: pyutClass.displayParameters.value,
XmlConstants.ATTR_DISPLAY_CONSTRUCTOR: pyutClass.displayConstructor.value,
XmlConstants.ATTR_DISPLAY_DUNDER_METHODS: pyutClass.displayDunderMethods.value,
XmlConstants.ATTR_DISPLAY_FIELDS: str(pyutClass.showFields),
XmlConstants.ATTR_DISPLAY_STEREOTYPE: str(pyutClass.displayStereoType),
XmlConstants.ATTR_FILENAME: pyutClass.fileName,
}

attributes = attributes | commonAttributes
Expand Down
14 changes: 8 additions & 6 deletions src/oglio/toXmlV11/XmlConstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ class XmlConstants:
ATTR_TYPE: str = 'type'
ATTR_TITLE: str = 'title'

ATTR_DEFAULT_VALUE: str = 'defaultValue'
ATTR_DISPLAY_STEREOTYPE: str = 'displayStereotype'
ATTR_DISPLAY_METHODS: str = 'displayMethods'
ATTR_DISPLAY_FIELDS: str = 'displayFields'
ATTR_DISPLAY_PARAMETERS: str = 'displayParameters'
ATTR_FILE_NAME: str = 'fileName'
ATTR_DEFAULT_VALUE: str = 'defaultValue'
ATTR_DISPLAY_STEREOTYPE: str = 'displayStereotype'
ATTR_DISPLAY_METHODS: str = 'displayMethods'
ATTR_DISPLAY_FIELDS: str = 'displayFields'
ATTR_DISPLAY_PARAMETERS: str = 'displayParameters'
ATTR_DISPLAY_CONSTRUCTOR: str = 'displayConstructor'
ATTR_DISPLAY_DUNDER_METHODS: str = 'displayDunderMethods'
ATTR_FILE_NAME: str = 'fileName'

ATTR_METHOD_RETURN_TYPE: str = 'returnType'

Expand Down
4 changes: 2 additions & 2 deletions tests/resources/testdata/CrazyControlPointsV11.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<PyutProject version="11" CodePath="">
<PyutDocument type="CLASS_DIAGRAM" title="CrazyAssociation" scrollPositionX="0" scrollPositionY="0" pixelsPerUnitX="20" pixelsPerUnitY="20">
<OglClass width="95" height="37" x="125" y="125">
<PyutClass id="1" name="SourceClass" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
<PyutClass id="1" name="SourceClass" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayConstructor="Unspecified" displayDunderMethods="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
</OglClass>
<OglClass width="104" height="38" x="450" y="125">
<PyutClass id="2" name="DestinationClass" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
<PyutClass id="2" name="DestinationClass" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayConstructor="Unspecified" displayDunderMethods="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
</OglClass>
<OglLink sourceAnchorX="125" sourceAnchorY="146" destinationAnchorX="553" destinationAnchorY="147" spline="False">
<LabelCenter x="-54" y="-33" />
Expand Down
14 changes: 7 additions & 7 deletions tests/resources/testdata/MultiLinkDocumentV11.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@
<PyutProject version="11" CodePath="">
<PyutDocument type="CLASS_DIAGRAM" title="MultiLink" scrollPositionX="0" scrollPositionY="0" pixelsPerUnitX="20" pixelsPerUnitY="20">
<OglClass width="78" height="44" x="150" y="150">
<PyutClass id="1" name="Folder" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="">
<PyutClass id="1" name="Folder" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayConstructor="Unspecified" displayDunderMethods="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="">
<PyutField name="permissions" visibility="PRIVATE" type="" defaultValue="" />
</PyutClass>
</OglClass>
<OglClass width="88" height="50" x="151" y="302">
<PyutClass id="2" name="File" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="">
<PyutClass id="2" name="File" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayConstructor="Unspecified" displayDunderMethods="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="">
<PyutField name="size" visibility="PRIVATE" type="" defaultValue="" />
<PyutField name="name" visibility="PRIVATE" type="" defaultValue="" />
</PyutClass>
</OglClass>
<OglClass width="129" height="70" x="517" y="125">
<PyutClass id="3" name="Car" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="">
<PyutClass id="3" name="Car" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayConstructor="Unspecified" displayDunderMethods="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="">
<PyutField name="make" visibility="PRIVATE" type="" defaultValue="" />
<PyutField name="model" visibility="PRIVATE" type="" defaultValue="" />
<PyutField name="vin" visibility="PRIVATE" type="" defaultValue="" />
<PyutField name="modelYear" visibility="PRIVATE" type="" defaultValue="" />
</PyutClass>
</OglClass>
<OglClass width="81" height="50" x="525" y="300">
<PyutClass id="4" name="Wheel" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="">
<PyutClass id="4" name="Wheel" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayConstructor="Unspecified" displayDunderMethods="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="">
<PyutField name="size" visibility="PRIVATE" type="" defaultValue="" />
<PyutField name="width" visibility="PRIVATE" type="" defaultValue="" />
</PyutClass>
</OglClass>
<OglClass width="172" height="75" x="850" y="175">
<PyutClass id="5" name="Interface" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="">
<PyutClass id="5" name="Interface" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayConstructor="Unspecified" displayDunderMethods="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="">
<PyutMethod name="floatMethod" visibility="PUBLIC" returnType="float">
<SourceCode />
</PyutMethod>
Expand All @@ -40,10 +40,10 @@
</PyutClass>
</OglClass>
<OglClass width="99" height="44" x="875" y="350">
<PyutClass id="6" name="Implementor" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
<PyutClass id="6" name="Implementor" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayConstructor="Unspecified" displayDunderMethods="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
</OglClass>
<OglClass width="140" height="48" x="325" y="625">
<PyutClass id="7" name="LollipopImplementor" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
<PyutClass id="7" name="LollipopImplementor" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayConstructor="Unspecified" displayDunderMethods="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
</OglClass>
<OglLink sourceAnchorX="186" sourceAnchorY="193" destinationAnchorX="187" destinationAnchorY="302" spline="False">
<LabelCenter x="401" y="-8" />
Expand Down
4 changes: 2 additions & 2 deletions tests/resources/testdata/SimpleMultipleDocumentV11.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<PyutProject version="11" CodePath="/tmp/bogus/Ozzee.py">
<PyutDocument type="CLASS_DIAGRAM" title="Diagram 1" scrollPositionX="0" scrollPositionY="0" pixelsPerUnitX="20" pixelsPerUnitY="20">
<OglClass width="79" height="20" x="375" y="150">
<PyutClass id="1" name="ClassName1" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
<PyutClass id="1" name="ClassName1" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayConstructor="Unspecified" displayDunderMethods="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
</OglClass>
</PyutDocument>
<PyutDocument type="CLASS_DIAGRAM" title="Diagram 2" scrollPositionX="0" scrollPositionY="0" pixelsPerUnitX="20" pixelsPerUnitY="20">
<OglClass width="112" height="20" x="375" y="100">
<PyutClass id="2" name="SimpleClassName2" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
<PyutClass id="2" name="SimpleClassName2" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayConstructor="Unspecified" displayDunderMethods="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
</OglClass>
</PyutDocument>
</PyutProject>
2 changes: 1 addition & 1 deletion tests/resources/testdata/SingleClassDocumentV11.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PyutProject version="11" CodePath="">
<PyutDocument type="CLASS_DIAGRAM" title="SingleClassDiagram" scrollPositionX="0" scrollPositionY="0" pixelsPerUnitX="20" pixelsPerUnitY="20">
<OglClass width="429" height="145" x="300" y="175">
<PyutClass id="1" name="SingleClass" stereotype="noStereotype" displayMethods="True" displayParameters="DisplayParameters" displayFields="True" displayStereotype="True" fileName="" description="I am a single class">
<PyutClass id="1" name="SingleClass" stereotype="noStereotype" displayMethods="True" displayParameters="DisplayParameters" displayConstructor="Unspecified" displayDunderMethods="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="I am a single class">
<PyutMethod name="publicMethod" visibility="PUBLIC" returnType="str">
<SourceCode />
</PyutMethod>
Expand Down
2 changes: 1 addition & 1 deletion tests/resources/testdata/TextAndLinkedNotesV11.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PyutProject version="11" CodePath="">
<PyutDocument type="CLASS_DIAGRAM" title="TextNotes" scrollPositionX="0" scrollPositionY="0" pixelsPerUnitX="20" pixelsPerUnitY="20">
<OglClass width="112" height="59" x="100" y="125">
<PyutClass id="3" name="LinkedToClass" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
<PyutClass id="3" name="LinkedToClass" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayConstructor="Unspecified" displayDunderMethods="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
</OglClass>
<OglLink sourceAnchorX="239" sourceAnchorY="300" destinationAnchorX="156" destinationAnchorY="184" spline="False">
<PyutLink name="Notelink-6" type="NOTELINK" cardinalitySource="" cardinalityDestination="" bidirectional="False" sourceId="4" destinationId="3" />
Expand Down
4 changes: 2 additions & 2 deletions tests/resources/testdata/WackySplinesV11.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<PyutProject version="11" CodePath="">
<PyutDocument type="CLASS_DIAGRAM" title="WackySpline" scrollPositionX="0" scrollPositionY="1" pixelsPerUnitX="20" pixelsPerUnitY="20">
<OglClass width="104" height="54" x="100" y="150">
<PyutClass id="1" name="WackyClass2" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
<PyutClass id="1" name="WackyClass2" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayConstructor="Unspecified" displayDunderMethods="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
</OglClass>
<OglClass width="117" height="56" x="625" y="400">
<PyutClass id="2" name="WackyClass2" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
<PyutClass id="2" name="WackyClass2" stereotype="noStereotype" displayMethods="True" displayParameters="Unspecified" displayConstructor="Unspecified" displayDunderMethods="Unspecified" displayFields="True" displayStereotype="True" fileName="" description="" />
</OglClass>
<OglLink sourceAnchorX="625" sourceAnchorY="428" destinationAnchorX="132" destinationAnchorY="203" spline="True">
<ControlPoint x="229" y="511" />
Expand Down

0 comments on commit ff24210

Please sign in to comment.