make_files.py:55
base_filename is the network name (read from the csv file) with certain characters replaced (namely spaces).
This pattern is usually called 'slugify'
On github;
un33k has a unicode version for python called python-slugify
benlinton has a bash/cli project called slugify
In django there is a built-in called slugify
The code on line 55 needs to create a name which is acceptable for a file system, and this involves not just replacing spaces. This line could be replaced with a call to any of these projects above which can handle many more outlier cases than just replacing spaces (ie unicode, slashes, double extensions etc)
make_files.py:55
base_filename is the network name (read from the csv file) with certain characters replaced (namely spaces).
This pattern is usually called 'slugify'
On github;
un33k has a unicode version for python called python-slugify
benlinton has a bash/cli project called slugify
In django there is a built-in called slugify
The code on line 55 needs to create a name which is acceptable for a file system, and this involves not just replacing spaces. This line could be replaced with a call to any of these projects above which can handle many more outlier cases than just replacing spaces (ie unicode, slashes, double extensions etc)