has added a CSV format promotions file when running --promos. Item.py was added for moduling.
This commit is contained in:
4
co_op.py
4
co_op.py
@@ -2,6 +2,8 @@ from typing import Dict, List
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
from bs4.element import Tag
|
||||
|
||||
from item import Item
|
||||
from supermarket_chain import SupermarketChain
|
||||
|
||||
|
||||
@@ -31,6 +33,6 @@ class CoOp(SupermarketChain):
|
||||
return 'Co-Op'
|
||||
|
||||
@staticmethod
|
||||
def get_items(promo: Tag, items_dict: Dict[str, str]) -> List[str]:
|
||||
def get_items(promo: Tag, items_dict: Dict[str, Item]) -> List[Item]:
|
||||
promo_item = items_dict.get(promo.find('ItemCode').text)
|
||||
return [promo_item] if promo_item else []
|
||||
|
Reference in New Issue
Block a user