コード例 #1
0
ファイル: scanner-0.1.7b.py プロジェクト: mma66mma/ipmacc
#                  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)
コード例 #2
0
ファイル: scanner-0.2.0b.py プロジェクト: ebads67/ipmacc
#                                    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)