replaced the member '_class_name' by the 'class.__name__'
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from chains.mahsaneiHashook import MahsaneiHashook
|
||||
from supermarket_chain import SupermarketChain
|
||||
|
||||
|
||||
class Bareket(MahsaneiHashook):
|
||||
class Bareket(MahsaneiHashook, SupermarketChain):
|
||||
pass
|
||||
|
@@ -26,6 +26,5 @@ class CerberusWebClient:
|
||||
return download_url
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def username(self):
|
||||
pass
|
||||
return repr(type(self))
|
||||
|
@@ -1,5 +1,6 @@
|
||||
from chains.mahsaneiHashook import MahsaneiHashook
|
||||
from supermarket_chain import SupermarketChain
|
||||
|
||||
|
||||
class CoOp(MahsaneiHashook):
|
||||
class CoOp(MahsaneiHashook, SupermarketChain):
|
||||
pass
|
||||
|
@@ -4,8 +4,3 @@ from supermarket_chain import SupermarketChain
|
||||
|
||||
class DorAlon(CerberusWebClient, SupermarketChain):
|
||||
_date_hour_format = '%Y-%m-%d %H:%M:%S'
|
||||
_class_name = 'DorAlon'
|
||||
|
||||
@property
|
||||
def username(self):
|
||||
return self._class_name
|
||||
|
@@ -4,8 +4,3 @@ from supermarket_chain import SupermarketChain
|
||||
|
||||
class Freshmarket(CerberusWebClient, SupermarketChain):
|
||||
_date_hour_format = '%Y-%m-%d %H:%M:%S'
|
||||
_class_name = 'Freshmarket'
|
||||
|
||||
@property
|
||||
def username(self):
|
||||
return self._class_name
|
||||
|
@@ -4,8 +4,3 @@ from supermarket_chain import SupermarketChain
|
||||
|
||||
class HaziHinam(CerberusWebClient, SupermarketChain):
|
||||
_date_hour_format = '%Y-%m-%d %H:%M:%S'
|
||||
_class_name = 'HaziHinam'
|
||||
|
||||
@property
|
||||
def username(self):
|
||||
return self._class_name
|
||||
|
@@ -4,8 +4,3 @@ from supermarket_chain import SupermarketChain
|
||||
|
||||
class Keshet(CerberusWebClient, SupermarketChain):
|
||||
_date_hour_format = '%Y-%m-%d %H:%M:%S'
|
||||
_class_name = 'Keshet'
|
||||
|
||||
@property
|
||||
def username(self):
|
||||
return self._class_name
|
||||
|
@@ -3,10 +3,4 @@ from supermarket_chain import SupermarketChain
|
||||
|
||||
|
||||
class OsherAd(CerberusWebClient, SupermarketChain):
|
||||
|
||||
_date_hour_format = '%Y-%m-%d %H:%M:%S'
|
||||
_class_name = 'OsherAd'
|
||||
|
||||
@property
|
||||
def username(self):
|
||||
return self._class_name
|
||||
|
@@ -4,8 +4,3 @@ from supermarket_chain import SupermarketChain
|
||||
|
||||
class RamiLevi(CerberusWebClient, SupermarketChain):
|
||||
_date_hour_format = '%Y-%m-%d %H:%M:%S'
|
||||
_class_name = 'RamiLevi'
|
||||
|
||||
@property
|
||||
def username(self):
|
||||
return self._class_name
|
||||
|
@@ -4,7 +4,7 @@ from bs4 import BeautifulSoup
|
||||
from supermarket_chain import SupermarketChain
|
||||
|
||||
|
||||
class ShuferSal(SupermarketChain):
|
||||
class Shufersal(SupermarketChain):
|
||||
|
||||
@staticmethod
|
||||
def get_download_url(store_id: int, category: SupermarketChain.XMLFilesCategory, session: requests.Session) -> str:
|
||||
|
@@ -4,8 +4,7 @@ from supermarket_chain import SupermarketChain
|
||||
|
||||
class StopMarket(CerberusWebClient, SupermarketChain):
|
||||
_date_hour_format = '%Y-%m-%d %H:%M:%S'
|
||||
_class_name = 'Stop_Market'
|
||||
|
||||
@property
|
||||
def username(self):
|
||||
return self._class_name
|
||||
return 'Stop_Market'
|
||||
|
@@ -4,7 +4,3 @@ from supermarket_chain import SupermarketChain
|
||||
|
||||
class TivTaam(CerberusWebClient, SupermarketChain):
|
||||
_class_name = 'TivTaam'
|
||||
|
||||
@property
|
||||
def username(self):
|
||||
return self._class_name
|
||||
|
@@ -1,5 +1,6 @@
|
||||
from chains.mahsaneiHashook import MahsaneiHashook
|
||||
from supermarket_chain import SupermarketChain
|
||||
|
||||
|
||||
class Victory(MahsaneiHashook):
|
||||
class Victory(MahsaneiHashook, SupermarketChain):
|
||||
pass
|
||||
|
@@ -4,8 +4,3 @@ from supermarket_chain import SupermarketChain
|
||||
|
||||
class Yohananof(CerberusWebClient, SupermarketChain):
|
||||
_date_hour_format = '%Y-%m-%d %H:%M:%S'
|
||||
_class_name = 'Yohananof'
|
||||
|
||||
@property
|
||||
def username(self):
|
||||
return self._class_name
|
||||
|
2
main.py
2
main.py
@@ -29,7 +29,7 @@ from chains import (
|
||||
Path(RESULTS_DIRNAME).mkdir(exist_ok=True)
|
||||
Path(RAW_FILES_DIRNAME).mkdir(exist_ok=True)
|
||||
|
||||
chain_dict = {repr(chain): chain() for chain in SupermarketChain.__subclasses__()}
|
||||
chain_dict = {repr(chain): chain() if callable(chain) else None for chain in SupermarketChain.__subclasses__()}
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = ArgumentParser()
|
||||
|
@@ -126,8 +126,3 @@ class SupermarketChain(object, metaclass=Meta):
|
||||
manufacturer=item.find(re.compile(r'Manufacture[r]?Name')).text,
|
||||
code=item.find('ItemCode').text
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@abstractmethod
|
||||
def __repr__(cls):
|
||||
pass
|
||||
|
Reference in New Issue
Block a user