EXIT_CODE = 0 for item in Test_List: EXIT_CODE += doctest.testfile( os.path.join("Test", item), optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS, verbose=False)[0] if EXIT_CODE == 0: print("Test passed!") else: print("Test failed!") sys.exit(EXIT_CODE) except Exception: print("Test folder not found!!") sys.exit(1) check_update(Version) while not EXITFLAG: tprint("OPEM") tprint("v" + str(Version)) print(Description_Menu["Links"]) description_print("Overview", Description_Menu) tprint("Models", font="larry3d") for i, item in enumerate(MENUKEYS): print(str(i + 1) + "-" + item) try: ANALYSISINDEX = int(input(("\nPlease select a model : "))) except Exception: ANALYSISINDEX = -1 if ANALYSISINDEX - 1 in range(len(MENUKEYS)): ANALYSISNAME = MENUKEYS[ANALYSISINDEX - 1] description_print(ANALYSISNAME, Description_Menu)
if __name__ == "__main__": args = sys.argv argsup = list(map(str.upper, args)) Menu={"Amphlett_Analysis (Static)":Amphlett_Analysis,"Larminiee_Analysis (Static)":Larminiee_Analysis, "Chamberline_Kim_Analysis (Static)":Chamberline_Kim_Analysis, "Padulles_Analysis I (Dynamic)":Padulles1_Analysis,"Padulles_Analysis II (Dynamic)":Padulles2_Analysis, "Padulles_Hauer Analysis (Dynamic)":Padulles_Hauer_Analysis, "Padulles_Amphlett Analysis (Dynamic)":Padulles_Amphlett_Analysis} MenuKeys=list(Menu.keys()) MenuKeys.sort() if "TEST" in argsup: doctest.testfile("test.py", optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS, verbose=False) else: ExitFlag = False check_update() while not ExitFlag: tprint("OPEM") tprint("v" + str(Version)) for i,item in enumerate(MenuKeys): print(str(i+1)+"-"+item) try: AnalysisIndex=int(input(("Please Choose Analysis : "))) except Exception: AnalysisIndex=-1 if AnalysisIndex-1 in range(len(MenuKeys)): Menu[MenuKeys[AnalysisIndex-1]]() InputIndex = input("Press [R] to restart OPEM or any other key to exit.") if InputIndex.upper() != "R": ExitFlag = True