Reorder HTML cache file

This commit is contained in:
Veronica K. B. Olsen
2021-02-10 18:48:13 +01:00
parent 672ea6d6f2
commit bb9ca6e40f
+7 -7
View File
@@ -1052,14 +1052,14 @@ class GuiBuildNovel(QDialog):
nw.logException() nw.logException()
return False return False
if "htmlText" in theData.keys(): if "buildTime" in theData.keys():
self.htmlText = theData["htmlText"] self.buildTime = theData["buildTime"]
dataCount += 1
if "htmlStyle" in theData.keys(): if "htmlStyle" in theData.keys():
self.htmlStyle = theData["htmlStyle"] self.htmlStyle = theData["htmlStyle"]
dataCount += 1 dataCount += 1
if "buildTime" in theData.keys(): if "htmlText" in theData.keys():
self.buildTime = theData["buildTime"] self.htmlText = theData["htmlText"]
dataCount += 1
return dataCount == 2 return dataCount == 2
@@ -1072,9 +1072,9 @@ class GuiBuildNovel(QDialog):
try: try:
with open(buildCache, mode="w+", encoding="utf8") as outFile: with open(buildCache, mode="w+", encoding="utf8") as outFile:
outFile.write(json.dumps({ outFile.write(json.dumps({
"htmlText" : self.htmlText,
"htmlStyle" : self.htmlStyle,
"buildTime" : self.buildTime, "buildTime" : self.buildTime,
"htmlStyle" : self.htmlStyle,
"htmlText" : self.htmlText,
}, indent=2)) }, indent=2))
except Exception: except Exception:
logger.error("Failed to save build cache") logger.error("Failed to save build cache")