def default(argc): if argc.find(".txt") > 0: logFile = argc[0:argc.find(".txt")] + ".txt" else: logFile = argc + ".txt" if not AbsolutePath: logPath = LogReader.getLogPath(str(logFile)) else: logPath = argc if logPath is not None: if LogReader.getProcInfo(logPath) is None or LogReader.getTotalRam(logPath) is None: print("Something went wrong with {}. Skipping".format(logPath)) postItem(logPath) else: print("Could not find file {}".format(str(logFile)))
if len(assets) <= 0: print("Scan or type the serial numbers now. Return a blank line when finished") while True: line = sys.stdin.readline(); if line == '\n': break else: assets.add(line.rstrip() + ".txt"); workbook, ws = genXML(len(assets)); for x in assets: try: logpath = LogReader.getLogPath(x) if logpath is None: print("Error: {} not found.".format(x)) continue addServer(ws,logpath, index); index += 1; except Exception: print(traceback.print_exc()); print("Failed at S/N:"+x) getInfoFromXML() addInfoToXML(ws) genSingleXML()