Skip to content

Commit

Permalink
Fixes #22
Browse files Browse the repository at this point in the history
  • Loading branch information
Semprini committed May 22, 2021
1 parent bfa6b83 commit 62daa3f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
24 changes: 11 additions & 13 deletions mdg/sparx_xmi/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,21 +322,19 @@ def association_parse(package, source_element, dest_element, source, dest):

# If it's an association to or from a multiple then pluralize the name
# TODO: Allow pluralized name to be specified in UML
# Use opposing ends class name as attribute name for association
association.destination_name = association.destination.name.lower()
if association.destination_multiplicity[1] == '*':
association.destination_name += 's'
association.source_name = association.source.name.lower()
if association.source_multiplicity[1] == '*':
association.source_name += 's'

# Allow explicit naming
if dest_element.get('name') is not None:
association.destination_name = dest_element.get('name')
else:
# Use opposing ends class name as attribute name for association
association.destination_name = association.destination.name.lower()
if association.destination_multiplicity[1] == '*':
association.destination_name += 's'

association.source_name = dest_element.get('name')
if source_element.get('name') is not None:
association.source_name = source_element.get('name')
else:
# Use opposing ends class name as attribute name for association
association.source_name = association.source.name.lower()
if association.source_multiplicity[1] == '*':
association.source_name += 's'
association.destination_name = source_element.get('name')

# print('Assoc in {}: {} to {}: type = {}'.format(self.source.name, self.source_name, self.destination_name,
# self.association_type) )
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def find_packages(srcdir):

setuptools.setup(
name='pymdg',
version='0.5a3',
version='0.5a4',
author='Semprini',
author_email='[email protected]',
description='Model driven genration - from UML to Code & Docs',
Expand All @@ -30,8 +30,7 @@ def find_packages(srcdir):
packages=["mdg", ] + pymdg_packages,
include_package_data=True,
package_data={
# If any package contains *.txt or *.rst files, include them:
'': ['*.txt', '*.xml', '*.special', '*.jinja' ],
'': ['*.txt', '*.xml', '*.special', '*.jinja'],
},
entry_points={
'console_scripts': [
Expand Down

0 comments on commit 62daa3f

Please sign in to comment.