def readParsingInfo(self): parsingRequest = ParsingRequest() parsingRequestFile = readUserChoice(constants.PARSING_REQUEST_FILE, constants.PARSING_REQUEST_FILE_DEFAULT) if(os.path.isfile(parsingRequestFile)): readParsingInfoFromXMLRequestFile(parsingRequestFile, parsingRequest) else: parsingRequest.setValidFlag(False) deniedAction = "parsing request based this file" printInvalidParameterEnteredWarning(constants.PARSING_REQUEST_FILE, parsingRequestFile, deniedAction) return parsingRequest
def workingLoop(self): argumentName = constants.USER_CHOICE defaultValue = str(constants.USER_CHOICE_DEFAULT) guide = "Your choices:\n" + \ "%s: quit\n"%str(constants.USER_CHOICE_QUIT) + \ "%s: do nothing\n"%str(constants.USER_CHOICE_DO_NOTHING) + \ "%s: view manager status\n"%str(constants.USER_CHOICE_VIEW_MANAGER_STATUS) + \ "%s: submit parsing job"%str(constants.USER_CHOICE_SUBMIT_PARSING_JOB) validValues = [str(constants.USER_CHOICE_QUIT), str(constants.USER_CHOICE_DO_NOTHING), str(constants.USER_CHOICE_VIEW_MANAGER_STATUS), str(constants.USER_CHOICE_SUBMIT_PARSING_JOB)] while(self._runFlag): self.processUserRequest(int(readUserChoice(argumentName, defaultValue, guide, validValues)))