| Line 49... |
Line 49... |
| 49 |
update_banner,add_banner_uri,get_uri_mapping,add_campaign,get_campaigns, \
|
49 |
update_banner,add_banner_uri,get_uri_mapping,add_campaign,get_campaigns, \
|
| 50 |
delete_campaign, get_all_campaigns, get_amazon_listed_items, search_amazon_items, \
|
50 |
delete_campaign, get_all_campaigns, get_amazon_listed_items, search_amazon_items, \
|
| 51 |
get_count_for_amazonlisted_items, get_amazon_search_result_count,update_asin, \
|
51 |
get_count_for_amazonlisted_items, get_amazon_search_result_count,update_asin, \
|
| 52 |
add_or_update_snapdeal_item, get_snapdeal_item, get_all_snapdeal_items , get_snapdeal_items, \
|
52 |
add_or_update_snapdeal_item, get_snapdeal_item, get_all_snapdeal_items , get_snapdeal_items, \
|
| 53 |
search_snapdeal_items , get_count_for_snapdeal_items , get_snapdeal_search_result_count, \
|
53 |
search_snapdeal_items , get_count_for_snapdeal_items , get_snapdeal_search_result_count, \
|
| 54 |
get_active_banners_for_mobile_site, get_preffered_insurer_for_item
|
54 |
get_active_banners_for_mobile_site, get_preffered_insurer_for_item, get_snapdealitem_by_skuatsnapdeal
|
| 55 |
from shop2020.thriftpy.model.v1.catalog.ttypes import status
|
55 |
from shop2020.thriftpy.model.v1.catalog.ttypes import status
|
| 56 |
from shop2020.utils.Utils import log_entry, to_py_date
|
56 |
from shop2020.utils.Utils import log_entry, to_py_date
|
| 57 |
import datetime
|
57 |
import datetime
|
| 58 |
|
58 |
|
| 59 |
class CatalogServiceHandler:
|
59 |
class CatalogServiceHandler:
|
| Line 1325... |
Line 1325... |
| 1325 |
try:
|
1325 |
try:
|
| 1326 |
return get_snapdeal_search_result_count(searchterms)
|
1326 |
return get_snapdeal_search_result_count(searchterms)
|
| 1327 |
finally:
|
1327 |
finally:
|
| 1328 |
close_session()
|
1328 |
close_session()
|
| 1329 |
|
1329 |
|
| - |
|
1330 |
def getSnapdealItembySkuAtSnapdeal(self,skuatsnapdeal):
|
| - |
|
1331 |
try:
|
| - |
|
1332 |
return to_t_snapdeal_item(get_snapdealitem_by_skuatsnapdeal(skuatsnapdeal))
|
| - |
|
1333 |
finally:
|
| - |
|
1334 |
close_session()
|
| - |
|
1335 |
|
| 1330 |
def is_valid(item):
|
1336 |
def is_valid(item):
|
| 1331 |
if item.status in [status.ACTIVE, status.PAUSED, status.PAUSED_BY_RISK]:
|
1337 |
if item.status in [status.ACTIVE, status.PAUSED, status.PAUSED_BY_RISK]:
|
| 1332 |
if item.startDate:
|
1338 |
if item.startDate:
|
| 1333 |
return not(datetime.datetime.now() < item.startDate or item.sellingPrice == 0)
|
1339 |
return not(datetime.datetime.now() < item.startDate or item.sellingPrice == 0)
|
| 1334 |
else:
|
1340 |
else:
|