Git Product home page Git Product logo

Comments (2)

AnNeub avatar AnNeub commented on August 29, 2024

See patch, hope it helps. It only forwards parameter if mixin (user_module) is activated.

module_utilities.tpl

<     {{ c.eStructuralFeatures | map(attribute='name') | map('re_sub', '$', '=None') | join(', ') }}
---
>     {{ c.eStructuralFeatures| rejectattr('derived') | map(attribute='name') | map('re_sub', '$', '=None') | join(', ') }}
>     {%- if c.eSuperTypes %}, **kwargs{% endif %}
> {%- endmacro %}
> 
> {%- macro generate_super_init_args(c, user_module=False) -%}
>     {%- if user_module and c.eStructuralFeatures -%}
>     {{ c.eStructuralFeatures| rejectattr('derived') | map(attribute='name') | map('re_sub', '(.+)', '\g<0>= \g<0>') | join(', ') }}
>     {%- endif %}
>     {%- if c.eSuperTypes %}{{', ' if user_module and c.eStructuralFeatures else ''}}**kwargs{% endif %}
91c99
<     def __init__(self{{ generate_class_init_args(c) }}{% if c.eSuperTypes %}, **kwargs{% endif %}):
---
>     def __init__(self{{ generate_class_init_args(c) }}):
97,98c105,107
<         super().__init__({% if c.eSuperTypes %}**kwargs{% endif %})
<     {%- for feature in c.eStructuralFeatures | reject('type', ecore.EReference) %}
---
>         super().__init__({{ generate_super_init_args(c, user_module) }})
> 
>     {%- for feature in c.eStructuralFeatures | reject('type', ecore.EReference) | rejectattr('derived')%}
109,110c118,119
<     def __init__(self{{ generate_class_init_args(c) }}, **kwargs):
<         super().__init__({% if c.eSuperTypes %}**kwargs{% endif %})
---
>     def __init__(self{{ generate_class_init_args(c) }}):
>         super().__init__({{ generate_super_init_args(c, user_module) }})

from pyecoregen.

AnNeub avatar AnNeub commented on August 29, 2024

If found some bug in the patch, i have update the pre post. Should work now.

from pyecoregen.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.