예제 #1
0
 def getCustom_settings_WithHeader(custom_settings):
     req_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)),
                            settings['NEWSPIDER_MODULE'].split(".")[1],
                            custom_settings['JIRA_ID'])
     logger.info("spider Path: %s", req_dir)
     import glob
     os.chdir(req_dir)
     if glob.glob("*.xlsx") or glob.glob("*.xls"):
         headers = Utils.getExcelHeaders(
             os.path.join(req_dir,
                          glob.glob("*.xlsx")[0]))
         custom_settings['TOP_HEADER'] = headers['top_header']
         custom_settings['FIELDS_TO_EXPORT'] = headers['feed_expo']
         custom_settings['NULL_HEADERS'] = headers['null_header']
         return custom_settings
     else:
         raise Exception(
             'rquirement Excel File is missing in path: {}'.format(req_dir))
예제 #2
0
 def __headers(self, requirement_path):
     return Utils.getExcelHeaders(requirement_path)