labs4capella / python4capella

Python for Capella
Eclipse Public License 2.0
52 stars 10 forks source link

The EObject.get_class() load the Attribute class that may not be imported. #149

Closed ylussaud closed 1 year ago

ylussaud commented 1 year ago

See this discussion for more details.

ylussaud commented 1 year ago

The bug seems to be still present, see this discussion. We probably need to add a test to know if the main module has an attribute named Attribute:

AttributeError: module ‘main’ has no attribute ‘Attribute’
ylussaud commented 1 year ago

As a workaround you can include the module declaring the class Attribute:

# include needed for the requirement API
include('workspace://Python4Capella/simplified_api/requirement.py')
if False:
    from simplified_api.requirement import *
ylussaud commented 1 year ago

I added an error message to tell to import the requirement.py file.