Revize 342ea08a
Přidáno uživatelem Petr Hlaváč před téměř 5 roky(ů)
modules/crawler/DatasetProcessing/JISProcessor.py | ||
---|---|---|
1 |
from Utilities.CSV import CSVDataLine, CSVutils
|
|
1 |
from Utilities.CSV import CSVDataLine |
|
2 | 2 |
from Utilities import DateFormating |
3 | 3 |
|
4 | 4 |
|
5 | 5 |
def process_file(filename): |
6 | 6 |
""" |
7 |
Method that take path to crawled file and outputs date dictionary using method: |
|
8 |
CSVutils.export_data_to_csv(filename, date_dict) |
|
7 |
Method that take path to crawled file and outputs date dictionary: |
|
9 | 8 |
Date dictionary is a dictionary where keys are dates in format ddmmYYYYhh (0804201815) |
10 | 9 |
and value is dictionary where keys devices (specified in configuration file) |
11 | 10 |
and value is CSVDataLine.CSVDataLine with device,date and occurrence |
12 | 11 |
|
13 | 12 |
Args: |
14 |
filename: name of processed file
|
|
13 |
filename: name of processed file |
|
15 | 14 |
|
16 | 15 |
Returns: |
17 |
False if not implemented
|
|
18 |
True when implemented
|
|
16 |
None if not implemented
|
|
17 |
date_dict when implemented
|
|
19 | 18 |
""" |
20 | 19 |
date_dict = dict() |
21 | 20 |
|
modules/crawler/DatasetProcessing/KOLOBEZKYProcessor.py | ||
---|---|---|
1 |
from Utilities.CSV import CSVDataLine, CSVutils
|
|
1 |
from Utilities.CSV import CSVDataLine |
|
2 | 2 |
from Utilities import DateFormating |
3 | 3 |
|
4 | 4 |
|
5 | 5 |
def process_file(filename): |
6 | 6 |
""" |
7 |
Method that take path to crawled file and outputs date dictionary using method: |
|
8 |
CSVutils.export_data_to_csv(filename, date_dict) |
|
7 |
Method that take path to crawled file and outputs date dictionary: |
|
9 | 8 |
Date dictionary is a dictionary where keys are dates in format ddmmYYYYhh (0804201815) |
10 | 9 |
and value is dictionary where keys devices (specified in configuration file) |
11 | 10 |
and value is CSVDataLine.CSVDataLine with device,date and occurrence |
12 | 11 |
|
13 | 12 |
Args: |
14 |
filename: name of processed file
|
|
13 |
filename: name of processed file |
|
15 | 14 |
|
16 | 15 |
Returns: |
17 |
False if not implemented
|
|
18 |
True when implemented
|
|
16 |
None if not implemented
|
|
17 |
date_dict when implemented
|
|
19 | 18 |
""" |
20 | 19 |
date_dict = dict() |
21 | 20 |
|
modules/crawler/DatasetProcessing/WIFIProcessor.py | ||
---|---|---|
1 |
from Utilities.CSV import CSVDataLine, CSVutils
|
|
1 |
from Utilities.CSV import CSVDataLine |
|
2 | 2 |
from Utilities import DateFormating |
3 | 3 |
|
4 | 4 |
|
5 | 5 |
def process_file(filename): |
6 | 6 |
""" |
7 |
Method that take path to crawled file and outputs date dictionary using method: |
|
8 |
CSVutils.export_data_to_csv(filename, date_dict) |
|
7 |
Method that take path to crawled file and outputs date dictionary: |
|
9 | 8 |
Date dictionary is a dictionary where keys are dates in format ddmmYYYYhh (0804201815) |
10 | 9 |
and value is dictionary where keys devices (specified in configuration file) |
11 | 10 |
and value is CSVDataLine.CSVDataLine with device,date and occurrence |
12 | 11 |
|
13 | 12 |
Args: |
14 |
filename: name of processed file
|
|
13 |
filename: name of processed file |
|
15 | 14 |
|
16 | 15 |
Returns: |
17 |
False if not implemented
|
|
18 |
True when implemented
|
|
16 |
None if not implemented
|
|
17 |
date_dict when implemented
|
|
19 | 18 |
""" |
20 | 19 |
date_dict = dict() |
21 |
|
|
20 |
|
|
22 | 21 |
with open(filename, "r", encoding="utf-8") as file: |
23 | 22 |
|
24 | 23 |
for line in file: |
modules/crawler/PrepareNewDataset.py | ||
---|---|---|
43 | 43 |
dataset_name: Name of newly created dataset |
44 | 44 |
""" |
45 | 45 |
with open(PROCESSOR_PROGRAM_PATH + "/" + dataset_name + "Processor.py", "w") as file: |
46 |
file.write("from Utilities.CSV import CSVDataLine, CSVutils")
|
|
46 |
file.write("from Utilities.CSV import CSVDataLine") |
|
47 | 47 |
file.write("\n") |
48 | 48 |
file.write("\n") |
49 | 49 |
file.write("def process_file(filename):\n") |
Také k dispozici: Unified diff
Re #7937
- Upraveny komentáře pro processory v pipeline