2022.10.3 - Removed duplicated schematic name in generate command #92 #111
@ -11,7 +11,13 @@ class ABCTemplate(TemplateFileABC):
|
||||
TemplateFileABC.__init__(self)
|
||||
|
||||
self._name = f'{String.convert_to_snake_case(name)}_{schematic}.py'
|
||||
if schematic in name.lower():
|
||||
self._name = f'{String.convert_to_snake_case(name)}.py'
|
||||
|
||||
self._class_name = f'{String.first_to_upper(name)}{schematic_upper}'
|
||||
if schematic in name.lower():
|
||||
self._class_name = f'{String.first_to_upper(name)}'
|
||||
|
||||
self._path = path
|
||||
self._value = textwrap.dedent("""\
|
||||
from abc import ABC, abstractmethod
|
||||
|
@ -11,7 +11,13 @@ class ConfigModelTemplate(TemplateFileABC):
|
||||
TemplateFileABC.__init__(self)
|
||||
|
||||
self._name = f'{String.convert_to_snake_case(name)}_{schematic}.py'
|
||||
if schematic in name.lower():
|
||||
self._name = f'{String.convert_to_snake_case(name)}.py'
|
||||
|
||||
self._class_name = f'{String.first_to_upper(name)}{schematic_upper}'
|
||||
if schematic in name.lower():
|
||||
self._class_name = f'{String.first_to_upper(name)}'
|
||||
|
||||
self._path = path
|
||||
self._value = textwrap.dedent("""\
|
||||
import traceback
|
||||
|
@ -11,7 +11,13 @@ class EnumTemplate(TemplateFileABC):
|
||||
TemplateFileABC.__init__(self)
|
||||
|
||||
self._name = f'{String.convert_to_snake_case(name)}_{schematic}.py'
|
||||
if schematic in name.lower():
|
||||
self._name = f'{String.convert_to_snake_case(name)}.py'
|
||||
|
||||
self._class_name = f'{String.first_to_upper(name)}{schematic_upper}'
|
||||
if schematic in name.lower():
|
||||
self._class_name = f'{String.first_to_upper(name)}'
|
||||
|
||||
self._path = path
|
||||
self._value = textwrap.dedent("""\
|
||||
from enum import Enum
|
||||
|
@ -12,6 +12,9 @@ class InitTemplate(TemplateFileABC):
|
||||
|
||||
self._name = f'__init__.py'
|
||||
self._class_name = f'{String.first_to_upper(name)}{schematic_upper}'
|
||||
if schematic in name.lower():
|
||||
self._class_name = f'{String.first_to_upper(name)}'
|
||||
|
||||
self._path = path
|
||||
self._value = textwrap.dedent("""\
|
||||
# imports
|
||||
|
@ -11,7 +11,13 @@ class PipeTemplate(TemplateFileABC):
|
||||
TemplateFileABC.__init__(self)
|
||||
|
||||
self._name = f'{String.convert_to_snake_case(name)}_{schematic}.py'
|
||||
if schematic in name.lower():
|
||||
self._name = f'{String.convert_to_snake_case(name)}.py'
|
||||
|
||||
self._class_name = f'{String.first_to_upper(name)}{schematic_upper}'
|
||||
if schematic in name.lower():
|
||||
self._class_name = f'{String.first_to_upper(name)}'
|
||||
|
||||
self._path = path
|
||||
self._value = textwrap.dedent("""\
|
||||
from cpl_core.pipes.pipe_abc import PipeABC
|
||||
|
@ -11,7 +11,13 @@ class ServiceTemplate(TemplateFileABC):
|
||||
TemplateFileABC.__init__(self)
|
||||
|
||||
self._name = f'{String.convert_to_snake_case(name)}_{schematic}.py'
|
||||
if schematic in name.lower():
|
||||
self._name = f'{String.convert_to_snake_case(name)}.py'
|
||||
|
||||
self._class_name = f'{String.first_to_upper(name)}{schematic_upper}'
|
||||
if schematic in name.lower():
|
||||
self._class_name = f'{String.first_to_upper(name)}'
|
||||
|
||||
self._path = path
|
||||
self._value = textwrap.dedent("""\
|
||||
class $Name:
|
||||
|
@ -11,7 +11,13 @@ class TestCaseTemplate(TemplateFileABC):
|
||||
TemplateFileABC.__init__(self)
|
||||
|
||||
self._name = f'{String.convert_to_snake_case(name)}_{schematic}.py'
|
||||
if schematic in name.lower():
|
||||
self._name = f'{String.convert_to_snake_case(name)}.py'
|
||||
|
||||
self._class_name = f'{String.first_to_upper(name)}{schematic_upper}'
|
||||
if schematic in name.lower():
|
||||
self._class_name = f'{String.first_to_upper(name)}'
|
||||
|
||||
self._path = path
|
||||
self._value = textwrap.dedent("""\
|
||||
import unittest
|
||||
|
@ -11,7 +11,13 @@ class ThreadTemplate(TemplateFileABC):
|
||||
TemplateFileABC.__init__(self)
|
||||
|
||||
self._name = f'{String.convert_to_snake_case(name)}_{schematic}.py'
|
||||
if schematic in name.lower():
|
||||
self._name = f'{String.convert_to_snake_case(name)}.py'
|
||||
|
||||
self._class_name = f'{String.first_to_upper(name)}{schematic_upper}'
|
||||
if schematic in name.lower():
|
||||
self._class_name = f'{String.first_to_upper(name)}'
|
||||
|
||||
self._path = path
|
||||
self._value = textwrap.dedent("""\
|
||||
import threading
|
||||
|
@ -11,7 +11,13 @@ class ValidatorTemplate(TemplateFileABC):
|
||||
TemplateFileABC.__init__(self)
|
||||
|
||||
self._name = f'{String.convert_to_snake_case(name)}_{schematic}.py'
|
||||
if schematic in name.lower():
|
||||
self._name = f'{String.convert_to_snake_case(name)}.py'
|
||||
|
||||
self._class_name = f'{String.first_to_upper(name)}{schematic_upper}'
|
||||
if schematic in name.lower():
|
||||
self._class_name = f'{String.first_to_upper(name)}'
|
||||
|
||||
self._path = path
|
||||
self._value = textwrap.dedent("""\
|
||||
from cpl_core.configuration.validator_abc import ValidatorABC
|
||||
|
Loading…
Reference in New Issue
Block a user