replaced the member '_class_name' by the 'class.__name__'

This commit is contained in:
KorenLazar
2021-02-07 08:18:22 +02:00
parent 67bff9fa76
commit 9983d07c2b
17 changed files with 11 additions and 55 deletions

View File

@@ -1,5 +1,6 @@
from chains.mahsaneiHashook import MahsaneiHashook
from supermarket_chain import SupermarketChain
class Bareket(MahsaneiHashook):
class Bareket(MahsaneiHashook, SupermarketChain):
pass

View File

@@ -26,6 +26,5 @@ class CerberusWebClient:
return download_url
@property
@abstractmethod
def username(self):
pass
return repr(type(self))

View File

@@ -1,5 +1,6 @@
from chains.mahsaneiHashook import MahsaneiHashook
from supermarket_chain import SupermarketChain
class CoOp(MahsaneiHashook):
class CoOp(MahsaneiHashook, SupermarketChain):
pass

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -22,7 +22,7 @@ class MahsaneiHashook(SupermarketChain):
req_res: requests.Response = requests.get(url)
soup = BeautifulSoup(req_res.text, features='lxml')
suffix: str = soup.find('a', href=lambda value: value and category.name.replace('s', '') in value
and f'-{store_id:03d}-20' in value).attrs['href']
and f'-{store_id:03d}-20' in value).attrs['href']
down_url: str = prefix + suffix
print(down_url)
return down_url

View File

@@ -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

View File

@@ -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

View File

@@ -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:

View File

@@ -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'

View File

@@ -4,7 +4,3 @@ from supermarket_chain import SupermarketChain
class TivTaam(CerberusWebClient, SupermarketChain):
_class_name = 'TivTaam'
@property
def username(self):
return self._class_name

View File

@@ -1,5 +1,6 @@
from chains.mahsaneiHashook import MahsaneiHashook
from supermarket_chain import SupermarketChain
class Victory(MahsaneiHashook):
class Victory(MahsaneiHashook, SupermarketChain):
pass

View File

@@ -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