-
Notifications
You must be signed in to change notification settings - Fork 3
/
exporter.py
36 lines (28 loc) · 941 Bytes
/
exporter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from typing import List
from cart import Cart
from product import Product
"""
connector query
POST http://source.com/mp_connector/connector.php?token=0D0D3A92286CBC3D6A87C15F1A144F62&action=query&cart=prestashop
{"query": base64({
"product": {
"type": "select",
"query": "select * from ps_product limit 0,2"
},
"product_attribute": {
"type":"select",
"query":"select * from ps_product_attribute limit 0,2"
}
})
}
"""
class PrestashopExporter:
def __init__(self, source_data: List[Product], cart: Cart) -> None:
self.source_data = source_data
self.cart = cart
def start(self) -> int:
migrated_entities_count = 0
# implement the exporter logic here
return migrated_entities_count
def get_exporter(source_data: list, cart: Cart):
return PrestashopExporter(source_data=source_data, cart=cart)