Change output_filename_safepattern to replace leading '.' for benefit of *nix OSes.

This commit is contained in:
Jim Miller
2015-09-08 08:03:10 -05:00
parent 94b44c9519
commit 84a308289c
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -148,8 +148,10 @@ zip_filename: ${title}-${siteabbrev}_${storyId}${formatext}.zip
## zip_filename.
allow_unsafe_filename: false
## The regex pattern of 'unsafe' filename chars for above.
#output_filename_safepattern:[^a-zA-Z0-9_\. \[\]\(\)&'-]+
## The regex pattern of 'unsafe' filename chars for above. First
## character . OR any one or more characters that are NOT a letter,
## number, or one of _. []()&'-
output_filename_safepattern:(^\.|/\.|[^a-zA-Z0-9_\. \[\]\(\)&'-]+)
## entries to make epub subjects and calibre tags
## lastupdate creates two tags: "Last Update Year/Month: %Y/%m" and "Last Update: %Y/%m/%d"
+1 -1
View File
@@ -927,7 +927,7 @@ class Story(Configurable):
if not allowunsafefilename:
values={}
pattern = re_compile(self.getConfig("output_filename_safepattern",r"[^a-zA-Z0-9_\. \[\]\(\)&'-]+"),"output_filename_safepattern")
pattern = re_compile(self.getConfig("output_filename_safepattern",r"(^\.|/\.|[^a-zA-Z0-9_\. \[\]\(\)&'-]+)"),"output_filename_safepattern")
for k in origvalues.keys():
values[k]=re.sub(pattern,'_', removeAllEntities(self.getMetadata(k)))