Rev 511 | Rev 596 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
from shop2020.thriftpy.model.v1.catalog.ttypes import Item, status, Warehouseimport datetimefrom shop2020.clients.InventoryClient import InventoryClientfrom shop2020.utils.Utils import to_java_dateimport xlrdfrom shop2020.clients.WidgetClient import WidgetClientinventory_client = InventoryClient()inventory_client.__start__()client = inventory_client.get_client()#For accessorieswb = xlrd.open_workbook('/home/rajveer/Desktop/accessories.xls')sheet = wb.sheet_by_index(0)count = 1for rownum in range(sheet.nrows):if count < 16:count = count + 1continueprint sheet.row_values(count)item = Item()item.catalogItemId = sheet.row_values(count)[0]item.category = sheet.row_values(count)[1]item.manufacturerName = sheet.row_values(count)[2]item.modelNumber = sheet.row_values(count)[3]item.modelName = sheet.row_values(count)[4]item.mrp = sheet.row_values(count)[5]item.sellingPrice = sheet.row_values(count)[6]item.vendorItemId = str(long(sheet.row_values(count)[8]))item.itemStatus = status.ACTIVEclient.addItem(item)count = count + 1"""#For phoneswb = xlrd.open_workbook('/home/rajveer/Desktop/phone-models.xls')sheet = wb.sheet_by_index(0)count = 0for rownum in range(sheet.nrows):#print sheet.row_values(rownum)print sheet.row_values(count)count = count + 1count = 1items = client.getAllItems(False);for item in items:item.catalogItemId = sheet.row_values(count)[0]item.category = sheet.row_values(count)[1]item.manufacturerName = sheet.row_values(count)[2]item.modelNumber = sheet.row_values(count)[3]item.modelName = sheet.row_values(count)[4]item.mrp = sheet.row_values(count)[5]item.sellingPrice = sheet.row_values(count)[6]item.itemStatus = status.ACTIVEcount = count + 1client.updateItem(item)"""