예제 #1
0
def local_count(name, out=os.getcwd() + "/report.JSON"):
    file_list = folder_reader(name)
    count = Counter()
    count.name = name
    count.source = name
    if file_list == None:
        count.name = name
        print(json.dumps(count))
    else:
        for file in file_list:
            count.count(name + "/" + file)
    writer(out, json_formulate(count))
예제 #2
0
def web_count(name, levels, out=None):
    folder = scrape(name, levels, out)
    file_list = folder_reader(folder)
    count = Counter()
    count.name = folder
    count.source = name
    if file_list == None:
        return
    else:
        for file in file_list:
            count.count(folder + "/" + file)
    if out == None:
        out = os.getcwd()
    writer(out + "/report.JSON", json_formulate(count))