Exemplo n.º 1
0
outputfile, desfile, prelistfile = "", "", ""
for fname in fnames:
    if '-o' in relation[fname]:
        outputfile = fname
    elif '-e' in relation[fname]:
        prelistfile = fname
    else:
        desfile = fname

# use dialog to open file
if args == ['-x']:
    path, fname = dialog_get()
    onefile = FileInfo(path, fname)
    print(onefile.char_num())
    print(onefile.line_num())
    print(onefile.word_num([]))
# dealing with the directory
elif desfile != '' and '-s' in relation[desfile]:
    directory = DirInfo(cur_file_dir())
    # determine the type needed
    tmplist = desfile.split('.')
    type = '.' + tmplist[-1]
    # get the required list
    localinfo = directory.build_infolist(type)
    for info in localinfo:
        str = ""
        if '-c' in relation[desfile]:
            print(info.char_num())
            str += info.char_num() + '\n'
        if '-w' in relation[desfile]:
            if prelistfile != "":