nimi-python icon indicating copy to clipboard operation
nimi-python copied to clipboard

Add support for generating private, python-only methods

Open sean-moore3 opened this issue 4 years ago • 1 comments

The code generator currently does not support generating a private method that is also a python-only method.

When a method's 'codegen_method' is set to 'python-only', it is automatically assumed to be public and documentation will be added to class.rst.

When a method's 'codegen_method' is set to private, the code generator will generate a private method but it will also add it to _library.py and _mock_helper.py.

In #1594, we desire to create a fancy initialize function that both is both private and python-only. _fancy_initialize should not be public as it should only be called from __init__ and not by the user. Additionally, it should not be placed in _library.py nor _mock_helper.py since it specific only to the python implementation of NI-DCPower.

For #1594, we opted to set codegen_method to private for _fancy_initialize. Once the code generator supports private and python-only, the metadata for 'fancy initialize' in nidcpower needs to be updated.

sean-moore3 avatar Jun 01 '21 21:06 sean-moore3

Discussed this a bit with @marcoskirsch. We'll probably want to either make codegen_method a list or create a new metadata field that determines which classes a method should be rendered in.

ni-jfitzger avatar Sep 21 '22 19:09 ni-jfitzger