Code and GUI text cleanup (#926)
* Move int range checkers from options class to common file * Improve error handling and reporting * Make some minor improvements to init and test suite * Fix 'trypewriter' to 'typewriter' typo * Remove menu path description in dialog help text * Improve the help text for entries in the Format menu * Reword a couple of dialog messages
This commit is contained in:
committed by
GitHub
parent
e71121f738
commit
e8bb130245
+14
-14
@@ -872,8 +872,8 @@ class GuiBuildNovel(QDialog):
|
||||
try:
|
||||
makeOdt.saveOpenDocText(savePath)
|
||||
wSuccess = True
|
||||
except Exception as e:
|
||||
errMsg = str(e)
|
||||
except Exception as exc:
|
||||
errMsg = str(exc)
|
||||
|
||||
elif theFmt == self.FMT_FODT:
|
||||
makeOdt = ToOdt(self.theProject, isFlat=True)
|
||||
@@ -881,8 +881,8 @@ class GuiBuildNovel(QDialog):
|
||||
try:
|
||||
makeOdt.saveFlatXML(savePath)
|
||||
wSuccess = True
|
||||
except Exception as e:
|
||||
errMsg = str(e)
|
||||
except Exception as exc:
|
||||
errMsg = str(exc)
|
||||
|
||||
elif theFmt == self.FMT_HTM:
|
||||
makeHtml = ToHtml(self.theProject)
|
||||
@@ -893,8 +893,8 @@ class GuiBuildNovel(QDialog):
|
||||
try:
|
||||
makeHtml.saveHTML5(savePath)
|
||||
wSuccess = True
|
||||
except Exception as e:
|
||||
errMsg = str(e)
|
||||
except Exception as exc:
|
||||
errMsg = str(exc)
|
||||
|
||||
elif theFmt == self.FMT_NWD:
|
||||
makeNwd = ToMarkdown(self.theProject)
|
||||
@@ -906,8 +906,8 @@ class GuiBuildNovel(QDialog):
|
||||
try:
|
||||
makeNwd.saveRawMarkdown(savePath)
|
||||
wSuccess = True
|
||||
except Exception as e:
|
||||
errMsg = str(e)
|
||||
except Exception as exc:
|
||||
errMsg = str(exc)
|
||||
|
||||
elif theFmt in (self.FMT_MD, self.FMT_GH):
|
||||
makeMd = ToMarkdown(self.theProject)
|
||||
@@ -923,8 +923,8 @@ class GuiBuildNovel(QDialog):
|
||||
try:
|
||||
makeMd.saveMarkdown(savePath)
|
||||
wSuccess = True
|
||||
except Exception as e:
|
||||
errMsg = str(e)
|
||||
except Exception as exc:
|
||||
errMsg = str(exc)
|
||||
|
||||
elif theFmt == self.FMT_JSON_H or theFmt == self.FMT_JSON_M:
|
||||
jsonData = {
|
||||
@@ -968,8 +968,8 @@ class GuiBuildNovel(QDialog):
|
||||
with open(savePath, mode="w", encoding="utf-8") as outFile:
|
||||
outFile.write(json.dumps(jsonData, indent=2))
|
||||
wSuccess = True
|
||||
except Exception as e:
|
||||
errMsg = str(e)
|
||||
except Exception as exc:
|
||||
errMsg = str(exc)
|
||||
|
||||
elif theFmt == self.FMT_PDF:
|
||||
try:
|
||||
@@ -983,8 +983,8 @@ class GuiBuildNovel(QDialog):
|
||||
self.docView.document().print(thePrinter)
|
||||
wSuccess = True
|
||||
|
||||
except Exception as e:
|
||||
errMsg - str(e)
|
||||
except Exception as exc:
|
||||
errMsg = str(exc)
|
||||
|
||||
else:
|
||||
# If the if statements above and here match, it should not
|
||||
|
||||
Reference in New Issue
Block a user