feat: temp barcode templates
This commit is contained in:
		
							
								
								
									
										21
									
								
								barcodes/attributes/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								barcodes/attributes/__init__.py
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +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()
 | 
			
		||||
		Reference in New Issue
	
	Block a user