24 lines
852 B
Python
24 lines
852 B
Python
import os
|
|
from dotenv import load_dotenv
|
|
from mail_order_bot.abcp_api.abcp_provider import AbcpProvider
|
|
from mail_order_bot.email_processor.order.auto_part_order import AutoPartOrder
|
|
from mail_order_bot.email_processor.order.auto_part_position import AutoPartPosition
|
|
if __name__ == "__main__":
|
|
print(__name__)# подгружаем переменные окружения
|
|
load_dotenv()
|
|
|
|
|
|
|
|
order = AutoPartOrder()
|
|
position = AutoPartPosition(sku="560300054", manufacturer="VST", requested_quantity=1)
|
|
order.add_position(position)
|
|
|
|
login = os.getenv('ABCP_LOGIN_SYSTEM')
|
|
password = os.getenv('ABCP_PASSWORD_SYSTEM')
|
|
provider = AbcpProvider(login=login, password=password)
|
|
|
|
result = provider.get_stock(position.sku, position.manufacturer)
|
|
|
|
print(order.positions[0].stock)
|
|
|
|
print(os.getenv('ABCP_LOGIN_SYSTEM')) |