Rev 14796 | Rev 14823 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
from dtr.utils import FetchLivePricesfrom shop2020.model.v1.dtr.impl.Convertors import to_t_livePricingclass DtrServiceHandler:'''classdocs'''def __init__(self):'''Constructor'''def getLatestPricing(self, skuBundleId, source_id):try:pricing_info = FetchLivePrices.getLatestPrice(skuBundleId, source_id)if len(pricing_info) == 0:raisereturn [to_t_livePricing(pricing) for pricing in pricing_info]except Exception as e:print "Dtr handler exception ",ereturn [to_t_livePricing(pricing) for pricing in [{}]]def isAlive(self, ):"""For checking weather service is active alive or not."""return Trueif __name__ == '__main__':dt = DtrServiceHandler()print dt.getLatestPricing(100, 1)