Improved cpl g templating & added custom templating #137

This commit is contained in:
2022-12-05 19:57:27 +01:00
parent d6e3b37f7f
commit d1c93abe2c
34 changed files with 527 additions and 539 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']
)

View File

@@ -0,0 +1 @@
# imports

View File

@@ -0,0 +1,4 @@
class Custom:
def __init__(self):
print('hello')