# action="store_False", dest="verbose", default=True, # help="don't print status messages to stdout") (options, args) = parser.parse_args() if options.filename == "": parser.print_help() exit(-1) if options.verbose: print("\n============SCANNER LOGS============\n") VERBOSE = 1 if os.path.isfile(options.filename): f = tempfile.NamedTemporaryFile(delete=False) f.write(" ") f.close() K = preprocr(options.filename, f.name) K.labeling() if VERBOSE: print 'Scanner will parse the preprocessed file located at ' + f.name J = scanner(f.name, "__inter.xml") J.labeling() if not options.keepprepr: os.remove(f.name) else: print "scanner: file not found: " + options.filename exit(-1)
# help="don't print status messages to stdout") (options, args) = parser.parse_args() if options.filename=="": parser.print_help() exit(-1) if options.verbose: print("\n============SCANNER LOGS============\n") VERBOSE=1 if os.path.isfile(options.filename): f = tempfile.NamedTemporaryFile(delete=False) f.write(" ") f.close() #print(open(options.filename).read()) K=preprocr(options.filename,f.name) K.labeling() if VERBOSE: print 'Scanner will parse the preprocessed file located at '+f.name J=scanner(f.name,"__inter.xml") J.labeling() if not options.keepprepr: os.remove(f.name) else: print "scanner: file not found: "+options.filename exit(-1)