changed chains' members to be 'immutable static'
This commit is contained in:
23
co_op.py
23
co_op.py
@@ -8,16 +8,12 @@ from supermarket_chain import SupermarketChain
|
||||
|
||||
|
||||
class CoOp(SupermarketChain):
|
||||
|
||||
promotion_tag_name = 'Sale'
|
||||
promotion_update_tag_name = 'PriceUpdateDate'
|
||||
date_format = '%Y/%m/%d'
|
||||
date_hour_format = '%Y/%m/%d %H:%M:%S'
|
||||
item_tag_name = 'Product'
|
||||
|
||||
@property
|
||||
def update_date_format(self):
|
||||
return CoOp.date_hour_format
|
||||
_promotion_tag_name = 'Sale'
|
||||
_promotion_update_tag_name = 'PriceUpdateDate'
|
||||
_date_format = '%Y/%m/%d'
|
||||
_date_hour_format = '%Y/%m/%d %H:%M:%S'
|
||||
_update_date_format = '%Y/%m/%d %H:%M:%S'
|
||||
_item_tag_name = 'Product'
|
||||
|
||||
@staticmethod
|
||||
def get_download_url(store_id: int, category: SupermarketChain.XMLFilesCategory, session: requests.Session) -> str:
|
||||
@@ -26,14 +22,11 @@ class CoOp(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']
|
||||
down_url = prefix + suffix
|
||||
and f'-{store_id:03d}-20' in value).attrs['href']
|
||||
down_url: str = prefix + suffix
|
||||
print(down_url)
|
||||
return down_url
|
||||
|
||||
class XMLFilesCategory(SupermarketChain.XMLFilesCategory):
|
||||
All, Promos, PromosFull, Prices, PricesFull, Stores = range(6)
|
||||
|
||||
def __repr__(self):
|
||||
return 'CoOp'
|
||||
|
||||
|
Reference in New Issue
Block a user