| Line 10... |
Line 10... |
| 10 |
to_t_voucher_item_mapping, to_t_insurer, to_t_Amazonlisted, to_t_ebay_item, \
|
10 |
to_t_voucher_item_mapping, to_t_insurer, to_t_Amazonlisted, to_t_ebay_item, \
|
| 11 |
to_t_uri_mapping, to_t_banner_list, to_t_campaign, to_t_snapdeal_item, \
|
11 |
to_t_uri_mapping, to_t_banner_list, to_t_campaign, to_t_snapdeal_item, \
|
| 12 |
to_t_snapdeal_item_details, to_t_product_feed_submit, to_t_marketplace_items, \
|
12 |
to_t_snapdeal_item_details, to_t_product_feed_submit, to_t_marketplace_items, \
|
| 13 |
to_t_marketplace_itemprice, to_t_marketplacepercentage, to_t_flipkart_item, \
|
13 |
to_t_marketplace_itemprice, to_t_marketplacepercentage, to_t_flipkart_item, \
|
| 14 |
to_t_flipkart_item_details, to_t_market_place_history, to_t_private_deal,to_t_amazonoutofsync, \
|
14 |
to_t_flipkart_item_details, to_t_market_place_history, to_t_private_deal,to_t_amazonoutofsync, \
|
| 15 |
to_t_private_deals_comparison, to_t_snapdeal_marketplace_item,to_t_flipkart_marketplace_item,to_t_competitor_pricing
|
15 |
to_t_private_deals_comparison, to_t_snapdeal_marketplace_item,to_t_flipkart_marketplace_item,to_t_competitor_pricing, \
|
| - |
|
16 |
to_t_amazon_promotion, to_t_Amazonlisted_promo
|
| 16 |
from shop2020.model.v1.catalog.impl.DataAcessors import add_item, retire_item, \
|
17 |
from shop2020.model.v1.catalog.impl.DataAcessors import add_item, retire_item, \
|
| 17 |
change_item_status, get_item, get_all_items, get_all_items_by_status, \
|
18 |
change_item_status, get_item, get_all_items, get_all_items_by_status, \
|
| 18 |
update_item, start_item_on, close_session, retire_item_on, \
|
19 |
update_item, start_item_on, close_session, retire_item_on, \
|
| 19 |
get_items_by_catalog_id, get_best_deals, get_best_deals_catalog_ids, \
|
20 |
get_items_by_catalog_id, get_best_deals, get_best_deals_catalog_ids, \
|
| 20 |
get_best_deals_count, get_best_sellers, get_latest_arrivals, \
|
21 |
get_best_deals_count, get_best_sellers, get_latest_arrivals, \
|
| Line 70... |
Line 71... |
| 70 |
get_marketplace_history_by_date, get_all_fbb_pricing_items, \
|
71 |
get_marketplace_history_by_date, get_all_fbb_pricing_items, \
|
| 71 |
get_private_deal_details, get_private_deal_items, add_or_update_private_deal, \
|
72 |
get_private_deal_details, get_private_deal_items, add_or_update_private_deal, \
|
| 72 |
get_all_active_private_deals, get_private_deals_catalog_ids, \
|
73 |
get_all_active_private_deals, get_private_deals_catalog_ids, \
|
| 73 |
get_private_deals_count,get_amazon_out_of_sync,get_all_private_deals_comparison, \
|
74 |
get_private_deals_count,get_amazon_out_of_sync,get_all_private_deals_comparison, \
|
| 74 |
get_all_snapdeal_marketplaceItem,get_all_flipkart_marketplaceItem, add_competitor_scraping, get_previous_competitor_scraping, \
|
75 |
get_all_snapdeal_marketplaceItem,get_all_flipkart_marketplaceItem, add_competitor_scraping, get_previous_competitor_scraping, \
|
| 75 |
get_upload_result_by_id
|
76 |
get_upload_result_by_id, add_amazon_promotion, get_amazon_promotion, update_amazon_promotion
|
| 76 |
from shop2020.thriftpy.model.v1.catalog.ttypes import status
|
77 |
from shop2020.thriftpy.model.v1.catalog.ttypes import status
|
| 77 |
from shop2020.utils.Utils import log_entry, to_py_date
|
78 |
from shop2020.utils.Utils import log_entry, to_py_date
|
| 78 |
import datetime
|
79 |
import datetime
|
| 79 |
|
80 |
|
| 80 |
class CatalogServiceHandler:
|
81 |
class CatalogServiceHandler:
|
| Line 1116... |
Line 1117... |
| 1116 |
finally:
|
1117 |
finally:
|
| 1117 |
close_session()
|
1118 |
close_session()
|
| 1118 |
|
1119 |
|
| 1119 |
def getAmazonItemDetails(self, amazonItemId):
|
1120 |
def getAmazonItemDetails(self, amazonItemId):
|
| 1120 |
try:
|
1121 |
try:
|
| 1121 |
return to_t_Amazonlisted(get_amazon_item_details(amazonItemId))
|
1122 |
return to_t_Amazonlisted_promo(get_amazon_item_details(amazonItemId))
|
| 1122 |
finally:
|
1123 |
finally:
|
| 1123 |
close_session()
|
1124 |
close_session()
|
| 1124 |
|
1125 |
|
| 1125 |
|
1126 |
|
| 1126 |
def updateAmazonItemDetails(self,amazonlisted):
|
1127 |
def updateAmazonItemDetails(self,amazonlisted):
|
| Line 1624... |
Line 1625... |
| 1624 |
def getUploadResultById(self,uploadId):
|
1625 |
def getUploadResultById(self,uploadId):
|
| 1625 |
try:
|
1626 |
try:
|
| 1626 |
return [to_t_competitor_pricing(item) for item in get_upload_result_by_id(uploadId)]
|
1627 |
return [to_t_competitor_pricing(item) for item in get_upload_result_by_id(uploadId)]
|
| 1627 |
finally:
|
1628 |
finally:
|
| 1628 |
close_session()
|
1629 |
close_session()
|
| - |
|
1630 |
|
| - |
|
1631 |
def addAmazonPromotion(self,amazonPromotions):
|
| 1629 |
|
1632 |
try:
|
| - |
|
1633 |
return add_amazon_promotion(amazonPromotions)
|
| - |
|
1634 |
except:
|
| - |
|
1635 |
return False
|
| - |
|
1636 |
finally:
|
| - |
|
1637 |
close_session()
|
| - |
|
1638 |
|
| - |
|
1639 |
def getAmazonPromotion(self,startDate,endDate):
|
| - |
|
1640 |
try:
|
| - |
|
1641 |
return [to_t_amazon_promotion(amazonPromotion) for amazonPromotion in get_amazon_promotion(startDate,endDate)]
|
| - |
|
1642 |
finally:
|
| - |
|
1643 |
close_session()
|
| - |
|
1644 |
|
| - |
|
1645 |
def updateAmazonPromotion(self,amazonPromotions):
|
| - |
|
1646 |
try:
|
| - |
|
1647 |
update_amazon_promotion(amazonPromotions)
|
| - |
|
1648 |
finally:
|
| - |
|
1649 |
close_session()
|
| 1630 |
|
1650 |
|
| 1631 |
|
1651 |
|
| 1632 |
if __name__ == '__main__':
|
1652 |
if __name__ == '__main__':
|
| 1633 |
items = get_all_alive_items()
|
1653 |
items = get_all_alive_items()
|
| 1634 |
ret_items = []
|
1654 |
ret_items = []
|