This commit is contained in:
2024-05-09 01:32:37 +03:00
parent 3e83cf6f92
commit 61d27d2389
16 changed files with 179 additions and 115 deletions

View File

@@ -1,21 +1,21 @@
from abc import abstractmethod, ABC
from .article_attribute_writer import ArticleAttributeWriter
from .name_attribute_writer import NameAttributeWriter
from ..barcode import Barcode
class BaseAttributeWriter(ABC):
@abstractmethod
def write(self, barcode: Barcode):
pass
class AttributeWriterFactory:
@staticmethod
def get_writer(key: str):
match key:
case 'name':
return NameAttributeWriter()
case 'article':
return ArticleAttributeWriter()
# from abc import abstractmethod, ABC
#
# from .article_attribute_writer import ArticleAttributeWriter
# from .name_attribute_writer import NameAttributeWriter
# from ..barcode import Barcode
#
#
# class BaseAttributeWriter(ABC):
# @abstractmethod
# def write(self, barcode: Barcode):
# pass
#
#
# class AttributeWriterFactory:
# @staticmethod
# def get_writer(key: str):
# match key:
# case 'name':
# return NameAttributeWriter()
# case 'article':
# return ArticleAttributeWriter()