Closed o7g8 closed 6 years ago
The fix allows to mix and match Unix- and Windows-style csv files. Let's assume we have both Unix- and Windows- editions of the structure and weights files:
struct_unix.csv
struct_win.csv
weights_unix.csv
weights_win.csv
The fix allows to run the script with all 4 combinations:
python transform/csv_as_enclosure_json.py --structure=struct_win.csv --weights=weigths_win.csv
python transform/csv_as_enclosure_json.py --structure=struct_win.csv --weights=weigths_unix.csv
python transform/csv_as_enclosure_json.py --structure=struct_unix.csv --weights=weigths_win.csv
python transform/csv_as_enclosure_json.py --structure=struct_unix.csv --weights=weigths_unix.csv
I've tested it both in Linux and Windows.
I have also noticed that code_age_csv_as_enclosure_json.py[92]
and csv_main_dev_as_knowledge_json.py[49]
can be improved in a similar way. Should I do it on a separate PR?
Excellent - thanks a lot for the clarification. Yes, it would be great if you could do a separate PR for the other two files.
@o7g8 thanks a lot for the patch -- looks good. Just one quick question: if someone on Windows runs
cloc
with the--unix
flag, as I recommend, they will get/paths/unix/style/
. Willos.path.split
on Windows handle that correctly?