def get_lists_from_excel(self): xls = DictExcel(basic.get_excel_path(self.name, self.d["file"])) self.products = dict() try: self.products["urls"] = xls.read_excel_collumn_for_urls(3, 15) self.products["product_ids"] = xls.read_excel_collumn_for_ids(1, 15) self.products["names"] = xls.read_excel_collumn(2, 15) except IOError as e: msg = "I/O error {0}: {1}".format(e.errno, e.strerror) msg += "\nError occurred for given file: {0}".format(self.d["file"]) self.exc.code_handler(103, msg=msg) except StandardError: msg = "Error reading excel file" msg += "\nError occurred for given file: {0}".format(self.d["file"]) self.exc.code_handler(103, msg=msg) self.products = xls.delete_duplicates_dict(self.products) self.products, self.no_urls = xls.separate_no_urls(self.products) self.products = xls._add_none_status(self.products) self.no_urls = xls._add_none_status(self.no_urls)
def get_lists_from_excel(self): xls = DictExcel(basic.get_excel_path(self.name, self.d['file'])) self.products = dict() try: self.products['urls'] = xls.read_excel_collumn_for_urls(3, 15) self.products['product_ids'] = xls.read_excel_collumn_for_ids(1, 15) self.products['names'] = xls.read_excel_collumn(2, 15) except IOError as e: msg = "I/O error {0}: {1}".format(e.errno, e.strerror) msg += "\nError occurred for given file: {0}".format(self.d['file']) self.exc.code_handler(103, msg=msg) except StandardError: msg = "Error reading excel file" msg += "\nError occurred for given file: {0}".format(self.d['file']) self.exc.code_handler(103, msg=msg) self.products= xls.delete_duplicates_dict(self.products) self.products, self.no_urls = xls.separate_no_urls(self.products) self.products = xls._add_none_status(self.products) self.no_urls = xls._add_none_status(self.no_urls)
def get_lists_from_excel(self): xls = CommonExcel(basic.get_excel_path(self.name, self.d['file'])) self.ordered = True try: self.url_list = xls.read_excel_collumn_for_urls(4, 1) self.id_list = xls.read_excel_collumn_for_ids(0, 1) self.shop_look_list = xls.read_excel_collumn(1, 1) self.shop_line_list = xls.read_excel_collumn(2, 1) try: self.order_list = xls.read_excel_collumn_for_ids(6, 1) except: self.ordered = False self.log.add_message("No order provided in this sheet.") except IOError as e: msg = "I/O error {0}: {1}".format(e.errno, e.strerror) msg += "\nError occurred for given file: {0}".format(self.d['file']) self.exc.code_handler(103, msg=msg) except StandardError: msg = "Error reading excel file" msg += "\nError occurred for given file: {0}".format(self.d['file']) self.exc.code_handler(103, msg=msg)