dont start filenames with .

This commit is contained in:
j 2013-07-29 15:58:22 +00:00
parent 4abbe25996
commit d5edde92e0

View file

@ -10,6 +10,8 @@ def safe_filename(filename):
filename = filename.replace(': ', '_ ') filename = filename.replace(': ', '_ ')
filename = filename.replace('/', '_') filename = filename.replace('/', '_')
filename = filename.replace('\\', '_') filename = filename.replace('\\', '_')
if filename.startswith('.'):
filename = '_' + filename[1:]
if filename.endswith('.'): if filename.endswith('.'):
filename = filename[:-1] + '_' filename = filename[:-1] + '_'
return filename return filename