args0 = parser.parse_args() if (args0.verbose): lg.setVerbose(args0.verbose) if (args0.color is None): args0.color = ("CLI_COLOR" in os.environ and sys.stderr.isatty()) lg.setColors(args0.color) return(args0) args = processOptions() if (args.pal): try: pfh = codecs.open(args.pal, mode='r', encoding=args.iencoding) except IOError: lg.error("Can't open -pal file '%s'." % (args.pal)) sys.exit() precnum = 0 while (True): rec0 = pfh.readline() if (rec0==""): break precnum += 1 rec0 = rec0.trim() if (not re.match('#[0-9a-fA-F]{6,6}', rec0)): lg.error("%s:%d: Bad record: '%s'." % (args.pal, precnum, rec0)) sys.exit() else: palColors[rec0] = 1 pfh.close() if (not args.files):
help='Add more messages (repeatable).') parser.add_argument("--version", action='version', version=__version__, help='Display version information, then exit.') parser.add_argument('files', type=str, nargs=argparse.REMAINDER, help='Path(s) to input file(s)') args0 = parser.parse_args() lg.setVerbose(args0.verbose) return (args0) args = processOptions() if (len(args.files) == 0): lg.error("No files specified....") sys.exit() for f in (args.files): lg.bumpStat("totalFiles") recs = doOneFile(f) lg.bumpStat("totalRecords", amount=recs) if (not args.quiet): lg.vMsg(0, "Done.") lg.showStats()
default=20, help='Height of inter-row spacing.') parser.add_argument("files", type=str, nargs=argparse.REMAINDER, help='Path(s) to input file(s)') args0 = parser.parse_args() return (args0) args = processOptions() if (len(args.files) == 0): lg.error("No files specified....") sys.exit() nodeIndex = {} # label: (id, x, y, w, h, shape) curID = args.idstart x0 = args.left y0 = args.top print(makeVueTop(args.files[0])) recnum = 0 for label0 in (open(args.files[0], 'r').readlines()): recnum += 1 label0 = label0.strip(".,:; \t\n\r\f") bkt = re.sub(r'^\s*\[[^\]]*\]\s*', '', label0) # Modifiers a la graphviz parts = re.split(r'\s+' + args.arrow + r'\s*', label0)