[WIP] Improved cpl new templating #139

This commit is contained in:
2022-12-05 23:08:52 +01:00
parent 6b8491eea2
commit 5f10603fe5
26 changed files with 822 additions and 16 deletions

View File

@@ -0,0 +1,27 @@
from cpl_cli.abc.generate_schematic_abc import GenerateSchematicABC
class Custom(GenerateSchematicABC):
def __init__(self, *args: str):
GenerateSchematicABC.__init__(self, *args)
def get_code(self) -> str:
code = """\
class $Name:
def __init__(self):
print('hello')
"""
x = self.build_code_str(code, Name=self._class_name)
return x
@classmethod
def register(cls):
GenerateSchematicABC.register(
cls,
'custom',
['cm', 'CM']
)