Merge branch 'dev' into view_details

This commit is contained in:
Veronica K. B. Olsen
2020-05-27 22:05:24 +02:00
6 changed files with 43 additions and 23 deletions
+1
View File
@@ -18,6 +18,7 @@ install:
- pip install --upgrade pip
- pip install -r requirements.txt
# - pip install pytest-faulthandler
- pip install PyVirtualDisplay==0.2.5
- pip install pytest-xvfb
- pip install pytest-cov
- pip install pytest-qt
+6
View File
@@ -1,5 +1,11 @@
# novelWriter ChangeLog
## Version 0.7 [2020-xx-xx]
**Other Changes**
* Dropped the usage of .bak copies of document files. This was the old method to ensure the document data was written successfully, but it uses twice the storage space. Instead, writing via a temp file is the safe way to save files. PR #248.
## Not Yet Released
**Bugfixes**
+8 -6
View File
@@ -147,12 +147,10 @@ class NWDoc():
mkdir(dataPath)
logger.debug("Created folder %s" % dataPath)
docTemp = path.join(dataPath, docFile+"~")
docBack = path.join(dataPath, docFile[:-3]+"bak")
itemPath = self.theProject.projTree.getItemPath(self.docHandle)
docMeta = "%%~ "+":".join(itemPath)+":"+self.theItem.itemName+"\n"
docTemp = path.join(dataPath, docFile+"~")
try:
with open(docTemp,mode="w",encoding="utf8") as outFile:
outFile.write(docMeta)
@@ -161,12 +159,16 @@ class NWDoc():
self.makeAlert(["Could not save document.",str(e)], nwAlert.ERROR)
return False
# If we're here, the file was successfully saved,
# so let's sort out the temps and backups
# Remove bak files from old file save method, if one exists
# This part can eventually be removed
docBack = path.join(dataPath, docFile[:-3]+"bak")
if path.isfile(docBack):
unlink(docBack)
# If we're here, the file was successfully saved, so we can
# replace the temp file with the actual file
if path.isfile(docPath):
rename(docPath, docBack)
unlink(docPath)
rename(docTemp, docPath)
self.theParent.statusBar.setStatus("Saved Document: %s" % self.theItem.itemName)
+1 -1
View File
@@ -1,4 +1,4 @@
%%~ b8136a5a774a0:98acd8c76c93a:Delete Me!
%%~ b8136a5a774a0:7031beac91f75:Delete Me!
### Delete Me!
This scene is trash.
+1 -1
View File
@@ -1,4 +1,4 @@
%%~ edca4be2fcaf8:7031beac91f75:Part 1
%%~ edca4be2fcaf8:7031beac91f75:Part One
# Part One
The first part.
+26 -15
View File
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<novelWriterXML appVersion="0.6.1" hexVersion="0x000601f0" fileVersion="1.0" saveCount="192" autoCount="36" timeStamp="2020-05-25 23:29:01">
<novelWriterXML appVersion="0.6.1" hexVersion="0x000601f0" fileVersion="1.0" saveCount="169" autoCount="28" timeStamp="2020-05-27 20:30:19">
<project>
<name>Sample Project</name>
<title>Sample Project</title>
@@ -10,9 +10,9 @@
<settings>
<spellCheck>True</spellCheck>
<autoOutline>True</autoOutline>
<lastEdited>ae7339df26ded</lastEdited>
<lastViewed>bb2c23b3c42cc</lastViewed>
<lastWordCount>941</lastWordCount>
<lastEdited>636b6aa9b697b</lastEdited>
<lastViewed>ba8a28a246524</lastViewed>
<lastWordCount>920</lastWordCount>
<autoReplace>
<A>B</A>
<B>E</B>
@@ -89,7 +89,7 @@
<charCount>23</charCount>
<wordCount>5</wordCount>
<paraCount>1</paraCount>
<cursorPos>0</cursorPos>
<cursorPos>27</cursorPos>
</item>
<item handle="e7ded148d6e4a" order="3" parent="7031beac91f75">
<name>A Folder</name>
@@ -122,7 +122,7 @@
<charCount>1199</charCount>
<wordCount>216</wordCount>
<paraCount>7</paraCount>
<cursorPos>527</cursorPos>
<cursorPos>825</cursorPos>
</item>
<item handle="bc0cbd2a407f3" order="2" parent="e7ded148d6e4a">
<name>Another Scene</name>
@@ -135,7 +135,7 @@
<charCount>476</charCount>
<wordCount>93</wordCount>
<paraCount>3</paraCount>
<cursorPos>551</cursorPos>
<cursorPos>428</cursorPos>
</item>
<item handle="ba8a28a246524" order="3" parent="e7ded148d6e4a">
<name>Interlude</name>
@@ -148,7 +148,7 @@
<charCount>633</charCount>
<wordCount>101</wordCount>
<paraCount>3</paraCount>
<cursorPos>1238</cursorPos>
<cursorPos>752</cursorPos>
</item>
<item handle="96b68994dfa3d" order="4" parent="e7ded148d6e4a">
<name>A Note on Structure</name>
@@ -161,7 +161,7 @@
<charCount>1692</charCount>
<wordCount>313</wordCount>
<paraCount>6</paraCount>
<cursorPos>1721</cursorPos>
<cursorPos>551</cursorPos>
</item>
<item handle="88706ddc78b1b" order="5" parent="e7ded148d6e4a">
<name>Chapter Two</name>
@@ -174,7 +174,11 @@
<charCount>139</charCount>
<wordCount>28</wordCount>
<paraCount>1</paraCount>
<<<<<<< HEAD
<cursorPos>237</cursorPos>
=======
<cursorPos>242</cursorPos>
>>>>>>> dev
</item>
<item handle="ae7339df26ded" order="6" parent="e7ded148d6e4a">
<name>We Found John!</name>
@@ -214,7 +218,7 @@
<charCount>49</charCount>
<wordCount>9</wordCount>
<paraCount>1</paraCount>
<cursorPos>24</cursorPos>
<cursorPos>65</cursorPos>
</item>
<item handle="bb2c23b3c42cc" order="1" parent="f7e2d9f330615">
<name>Jane Smith</name>
@@ -227,7 +231,7 @@
<charCount>55</charCount>
<wordCount>9</wordCount>
<paraCount>1</paraCount>
<cursorPos>25</cursorPos>
<cursorPos>71</cursorPos>
</item>
<item handle="15c4492bd5107" order="2" parent="None">
<name>Locations</name>
@@ -247,7 +251,7 @@
<charCount>76</charCount>
<wordCount>15</wordCount>
<paraCount>1</paraCount>
<cursorPos>20</cursorPos>
<cursorPos>93</cursorPos>
</item>
<item handle="f1471bef9f2ae" order="1" parent="15c4492bd5107">
<name>Space</name>
@@ -257,10 +261,17 @@
<expanded>False</expanded>
<exported>True</exported>
<layout>NOTE</layout>
<<<<<<< HEAD
<charCount>241</charCount>
<wordCount>51</wordCount>
<paraCount>3</paraCount>
<cursorPos>286</cursorPos>
=======
<charCount>115</charCount>
<wordCount>24</wordCount>
<paraCount>1</paraCount>
<cursorPos>135</cursorPos>
>>>>>>> dev
</item>
<item handle="5eaea4e8cdee8" order="2" parent="15c4492bd5107">
<name>Mars</name>
@@ -290,9 +301,9 @@
<expanded>False</expanded>
<exported>True</exported>
<layout>SCENE</layout>
<charCount>0</charCount>
<wordCount>0</wordCount>
<paraCount>0</paraCount>
<charCount>30</charCount>
<wordCount>6</wordCount>
<paraCount>1</paraCount>
<cursorPos>36</cursorPos>
</item>
</content>