Revision c0eac366 py_logs_splitter.py

View differences:

py_logs_splitter.py
8 8
import shutil as sh
9 9

  
10 10
SESSION_TOLERANCE=20
11
SESSION_INDEPENDENT_KEYWORDS=['rtt','timespread']
11
SESSION_INDEPENDENT_KEYWORDS=['TestResults','shortest','rtt','timespread','NetLoad','PSTestNET']
12 12

  
13 13
def name_splitter(folder):
14 14
# returns a dictionary of type: [timestamp] -> group_name
......
16 16
	for logfile in os.listdir(folder):
17 17
		if is_source_from_filename(logfile):
18 18
			source_info = logfile.split('.')[0].split('_')
19
			if len(source_info) > 4:
20
				session_groups[time_from_filename(logfile)] = source_info[3]
19
			if len(source_info) > 2:
20
				session_groups[time_from_filename(logfile)] = source_info[2]
21 21
			else:
22 22
				session_groups[time_from_filename(logfile)] = 'standard'
23 23
	return session_groups
......
31 31
				(int(time) > (int(keytime) - SESSION_TOLERANCE)):
32 32
			group = session_groups[keytime]
33 33

  
34
	if (logfile.split('.')[0].split('_')[3]) in session_groups.values():
35
		group = logfile.split('.')[0].split('_')[3]
34
	if (logfile.split('.')[0].split('_')[2]) in session_groups.values():
35
		group = logfile.split('.')[0].split('_')[2]
36 36
	else:
37 37
		group = None
38 38
	return group
......
62 62
		if os.path.isfile(folder+"/"+logfile):
63 63
			logtime = time_from_filename(logfile) 
64 64

  
65

  
66 65
			if session_independent(logfile):
67 66
				multiple_dst_copy(folder,logfile,[folder +'/'+ v for v in set(session_groups.values())])
68 67
			else:

Also available in: Unified diff