Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
__slots__ = ['manufacturer']
extractor: Type['VinDetails'] = None
def __init__(self, manufacturer: str = None):
self.manufacturer = manufacturer or self.title
@property
def title(self) -> str:
return self.__class__.__name__
def __str__(self):
return f'{self.title} ({self.manufacturer})'
class UnsupportedBrand(Brand):
"""Unsupported brand."""
class Lada(Brand):
extractor = AvtoVazDetails
class Nissan(Brand):
extractor = NissanDetails
class Opel(Brand):
extractor = OpelDetails
class Renault(Brand):
extractor = RenaultDetails
from .common import Brand
from .details import *
class Lada(Brand):
extractor = AvtoVazDetails
class Nissan(Brand):
extractor = NissanDetails
class Opel(Brand):
extractor = OpelDetails
class Renault(Brand):
extractor = RenaultDetails
from .common import Brand
from .details import *
class Lada(Brand):
extractor = AvtoVazDetails
class Nissan(Brand):
extractor = NissanDetails
class Opel(Brand):
extractor = OpelDetails
class Renault(Brand):
extractor = RenaultDetails
from .common import Brand
from .details import *
class Lada(Brand):
extractor = AvtoVazDetails
class Nissan(Brand):
extractor = NissanDetails
class Opel(Brand):
extractor = OpelDetails
class Renault(Brand):
def brand(self) -> Brand:
"""Brand object."""
wmi = self.wmi
brand = WMI.get(wmi)
if not brand:
brand = WMI.get(wmi[:2])
if isinstance(brand, str):
brand = Brand(brand)
if brand is None:
brand = UnsupportedBrand()
return brand