6 """Utility module loading questionare answers from the json questionare results
7 listed in (see config) QUESTIONARE (by def) subdir."""
9 def load_file(filename
):
10 with
open(filename
) as fin
:
15 for group_list
in dump
['group_lists']:
16 for player
in group_list
['list']:
17 if player
['skip'] != 'yes':
18 style
= player
['style']
19 vec
= [ style
['te'], style
['or'], style
['ag'], style
['th'] ]
25 d
[player
['name']] = tuple(vec
)
29 def scan_d(directory
):
31 for dirname
, dirnames
, filenames
in os
.walk(directory
):
32 # print path to all filenames.
33 for filename
in filenames
:
34 fn
= os
.path
.join(dirname
, filename
)
36 ds
.append(load_file(fn
))
38 logging
.warn("Scanning of questionare file '%s' failed, skipping."%fn
)
43 if __name__
== '__main__':
47 print scan_d('./QUESTIONARE')