Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 3692d853

Přidáno uživatelem Petr Hlaváč před asi 4 roky(ů)

Úprava komentářů

Zobrazit rozdíly:

modules/crawler/DatasetCrawler/JIS_crawler.py
30 30
        second_level_links = basic_crawler_functions.get_all_links(link)
31 31
        filtered_second_level_links = basic_crawler_functions.filter_links(second_level_links, regex)
32 32
        absolute_second_level_links = basic_crawler_functions.create_absolute_links(filtered_second_level_links, link)
33
        final_links = basic_crawler_functions.remove_downloaded_links(absolute_second_level_links, dataset_name)
34 33

  
35
        for file_link in final_links:
34
        for file_link in absolute_second_level_links:
36 35
            files.append(file_link)
37 36

  
37
    files = basic_crawler_functions.remove_downloaded_links(files, dataset_name)
38

  
38 39
    for file in files:
39 40
        basic_crawler_functions.download_file_from_url(file, dataset_name)
40 41

  
modules/crawler/DatasetCrawler/KOLOBEZKY_crawler.py
30 30
        second_level_links = basic_crawler_functions.get_all_links(link)
31 31
        filtered_second_level_links = basic_crawler_functions.filter_links(second_level_links, regex)
32 32
        absolute_second_level_links = basic_crawler_functions.create_absolute_links(filtered_second_level_links, link)
33
        final_links = basic_crawler_functions.remove_downloaded_links(absolute_second_level_links, dataset_name)
34 33

  
35
        for file_link in final_links:
34
        for file_link in absolute_second_level_links:
36 35
            files.append(file_link)
37 36

  
37
    files = basic_crawler_functions.remove_downloaded_links(files, dataset_name)
38

  
38 39
    for file in files:
39 40
        basic_crawler_functions.download_file_from_url(file, dataset_name)
40 41

  
modules/crawler/DatasetCrawler/WIFI_crawler.py
30 30
        second_level_links = basic_crawler_functions.get_all_links(link)
31 31
        filtered_second_level_links = basic_crawler_functions.filter_links(second_level_links, regex)
32 32
        absolute_second_level_links = basic_crawler_functions.create_absolute_links(filtered_second_level_links, link)
33
        final_links = basic_crawler_functions.remove_downloaded_links(absolute_second_level_links, dataset_name)
34 33

  
35
        for file_link in final_links:
34
        for file_link in absolute_second_level_links:
36 35
            files.append(file_link)
37 36

  
37
    files = basic_crawler_functions.remove_downloaded_links(files, dataset_name)
38

  
38 39
    for file in files:
39 40
        basic_crawler_functions.download_file_from_url(file, dataset_name)
40 41

  
modules/crawler/DatasetProcessing/JIS_processor.py
5 5
def process_file(filename):
6 6
    """
7 7
    Method that take path to crawled file and outputs date dictionary:
8
    Date dictionary is a dictionary where keys are dates in format ddmmYYYYhh (0804201815)
8
    Date dictionary is a dictionary where keys are dates in format YYYY-mm-dd-hh (2018-04-08-15)
9 9
    and value is dictionary where keys are devices (specified in configuration file)
10 10
    and value is CSVDataLine.csv_data_line with device,date and occurrence
11 11

  
modules/crawler/DatasetProcessing/KOLOBEZKY_processor.py
5 5
def process_file(filename):
6 6
    """
7 7
    Method that take path to crawled file and outputs date dictionary:
8
    Date dictionary is a dictionary where keys are dates in format ddmmYYYYhh (0804201815)
8
    Date dictionary is a dictionary where keys are dates in format YYYY-mm-dd-hh (2018-04-08-15)
9 9
    and value is dictionary where keys are devices (specified in configuration file)
10 10
    and value is CSVDataLine.csv_data_line with device,date and occurrence
11 11

  
modules/crawler/DatasetProcessing/WIFI_processor.py
5 5
def process_file(filename):
6 6
    """
7 7
    Method that take path to crawled file and outputs date dictionary:
8
    Date dictionary is a dictionary where keys are dates in format ddmmYYYYhh (0804201815)
8
    Date dictionary is a dictionary where keys are dates in format YYYY-mm-dd-hh (2018-04-08-15)
9 9
    and value is dictionary where keys are devices (specified in configuration file)
10 10
    and value is CSVDataLine.csv_data_line with device,date and occurrence
11 11

  
modules/crawler/prepare_new_dataset.py
21 21
    """
22 22
    with open(CONFIG_FILES_PATH + "/" + dataset_name + ".yaml", "w") as file:
23 23
        file.write("# jmeno datasetu, pod kterym bude zobrazen v aplikaci\n")
24
        file.write("dataset-name: " + dataset_name + "\n")
24
        file.write("display-name: " + dataset_name + "\n")
25 25
        file.write("# jednoslovný název datasetu, pod kterym bude reprezentovana v architektuře\n")
26 26
        file.write("dataset-name: " + dataset_name + "\n")
27 27
        file.write("# root slozka, ktera obsahuje odkazy na dataset\n")
......
49 49
        file.write("def process_file(filename):\n")
50 50
        file.write("    \"\"\"\n")
51 51
        file.write("    Method that take path to crawled file and outputs date dictionary:\n")
52
        file.write("    Date dictionary is a dictionary where keys are dates in format ddmmYYYYhh (0804201815)\n")
52
        file.write("    Date dictionary is a dictionary where keys are dates in format YYYY-mm-dd-hh (2018-04-08-15)\n")
53 53
        file.write("    and value is dictionary where keys are devices (specified in configuration file)\n")
54 54
        file.write("    and value is CSVDataLine.csv_data_line with device,date and occurrence\n")
55 55
        file.write("\n")
......
124 124
    create_default_config_file(dataset_name)
125 125

  
126 126
print("Zadejte jméno nového datasetu:\n")
127
prepare_dataset_structure(input().upper())
127

  
128
dataset_name = input().upper()
129

  
130
if dataset_name.isalpha():
131
    prepare_dataset_structure(dataset_name)
132
    print("Architektura vytvořena \n")
133
else:
134
    print("Jméno musí obsahovat pouze písmena z abecedy (bez mezer)\n")

Také k dispozici: Unified diff