Added generate abc command

This commit is contained in:
2021-03-10 22:29:42 +01:00
parent 0ff9920e9e
commit 82ffdfe278
5 changed files with 132 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import textwrap
from string import Template
class ABCTemplate:
@staticmethod
def get_abc_py(name: str) -> str:
string = textwrap.dedent("""\
from abc import ABC, abstractmethod
class $Name(ABC):
@abstractmethod
def __init__(self): pass
""")
return Template(string).substitute(
Name=name
)