Finished save file options for now. Still missing markdown and PDF

This commit is contained in:
Veronica K. B. Olsen
2020-05-10 21:27:28 +02:00
parent 26b8379ada
commit 771e44055d
3 changed files with 168 additions and 29 deletions
+10 -5
View File
@@ -529,11 +529,7 @@ class NWProject():
), nwAlert.WARN)
return False
cleanName = ""
for c in self.projName.strip():
if c.isalpha() or c.isdigit() or c == " ":
cleanName += c
cleanName = self.getFileSafeProjectName()
baseDir = path.join(self.mainConf.backupPath, cleanName)
if not path.isdir(baseDir):
try:
@@ -740,6 +736,15 @@ class NWProject():
# Getters
##
def getFileSafeProjectName(self):
"""Returns a filename safe version of the project name.
"""
cleanName = ""
for c in self.projName.strip():
if c.isalpha() or c.isdigit() or c == " ":
cleanName += c
return cleanName
def getSessionWordCount(self):
"""Returns the number of words added or removed this session.
"""