39 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Python
		
	
	
	
	
	
from .additional_info_attribute_getter import AdditionalInfoAttributeGetter
 | 
						|
from .article_attribute_getter import ArticleAttributeGetter
 | 
						|
from .brand_attribute_getter import BrandAttributeGetter
 | 
						|
from .client_name_attribute_getter import ClientNameAttributeGetter
 | 
						|
from .color_attribute_getter import ColorAttributeGetter
 | 
						|
from .company_name_attribute_getter import CompanyNameAttributeGetter
 | 
						|
from .composition_attribute_getter import CompositionAttributeGetter
 | 
						|
from .inn_attribute_getter import InnAttributeGetter
 | 
						|
from .name_attribute_getter import NameAttributeGetter
 | 
						|
from .size_attribute_getter import SizeAttributeGetter
 | 
						|
 | 
						|
 | 
						|
class AttributeWriterFactory:
 | 
						|
    @staticmethod
 | 
						|
    def get_writer(key: str):
 | 
						|
        match key:
 | 
						|
            case 'name':
 | 
						|
                return NameAttributeGetter()
 | 
						|
            case 'article':
 | 
						|
                return ArticleAttributeGetter()
 | 
						|
            case 'client.name':
 | 
						|
                return ClientNameAttributeGetter()
 | 
						|
            case 'client.company_name':
 | 
						|
                return CompanyNameAttributeGetter()
 | 
						|
            case 'client.inn':
 | 
						|
                return InnAttributeGetter()
 | 
						|
            case 'brand':
 | 
						|
                return BrandAttributeGetter()
 | 
						|
            case 'color':
 | 
						|
                return ColorAttributeGetter()
 | 
						|
            case 'composition':
 | 
						|
                return CompositionAttributeGetter()
 | 
						|
            case 'size':
 | 
						|
                return SizeAttributeGetter()
 | 
						|
            case 'additional_info':
 | 
						|
                return AdditionalInfoAttributeGetter()
 | 
						|
            case _:
 | 
						|
                return None
 |