Rename package from 'nw' to 'novelwriter' (#868)
* Rename nw folder to novelwriter * Rename nw to novelwriter in auxiliary files * Rename nw to novelwriter in main app source * Rename nw to novelwriter in tests * Make setup script for pdf docs less spammy
This commit is contained in:
committed by
GitHub
parent
2cf2eb9f55
commit
3403d98c72
@@ -25,8 +25,8 @@ import pytest
|
||||
from mock import causeOSError
|
||||
from tools import readFile
|
||||
|
||||
from nw.core import NWProject, NWDoc
|
||||
from nw.enum import nwItemClass, nwItemLayout
|
||||
from novelwriter.core import NWProject, NWDoc
|
||||
from novelwriter.enum import nwItemClass, nwItemLayout
|
||||
|
||||
|
||||
@pytest.mark.core
|
||||
|
||||
@@ -28,9 +28,9 @@ from shutil import copyfile
|
||||
from mock import causeException
|
||||
from tools import cmpFiles
|
||||
|
||||
from nw.core.project import NWProject
|
||||
from nw.core.index import NWIndex, countWords
|
||||
from nw.enum import nwItemClass, nwItemLayout
|
||||
from novelwriter.core.project import NWProject
|
||||
from novelwriter.core.index import NWIndex, countWords
|
||||
from novelwriter.enum import nwItemClass, nwItemLayout
|
||||
|
||||
|
||||
@pytest.mark.core
|
||||
|
||||
@@ -23,9 +23,9 @@ import pytest
|
||||
|
||||
from lxml import etree
|
||||
|
||||
from nw.core import NWProject
|
||||
from nw.core.item import NWItem
|
||||
from nw.enum import nwItemClass, nwItemType, nwItemLayout
|
||||
from novelwriter.core import NWProject
|
||||
from novelwriter.core.item import NWItem
|
||||
from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout
|
||||
|
||||
|
||||
@pytest.mark.core
|
||||
|
||||
@@ -26,9 +26,9 @@ import pytest
|
||||
from mock import causeOSError
|
||||
from tools import writeFile
|
||||
|
||||
from nw.core import NWProject
|
||||
from nw.core.options import OptionState
|
||||
from nw.constants import nwFiles
|
||||
from novelwriter.core import NWProject
|
||||
from novelwriter.core.options import OptionState
|
||||
from novelwriter.constants import nwFiles
|
||||
|
||||
|
||||
@pytest.mark.core
|
||||
|
||||
@@ -29,10 +29,10 @@ from lxml import etree
|
||||
from tools import cmpFiles, writeFile, readFile
|
||||
from mock import causeOSError
|
||||
|
||||
from nw.core.project import NWProject
|
||||
from nw.enum import nwItemClass, nwItemType, nwItemLayout
|
||||
from nw.common import formatTimeStamp
|
||||
from nw.constants import nwFiles
|
||||
from novelwriter.core.project import NWProject
|
||||
from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout
|
||||
from novelwriter.common import formatTimeStamp
|
||||
from novelwriter.constants import nwFiles
|
||||
|
||||
|
||||
@pytest.mark.core
|
||||
@@ -234,7 +234,7 @@ def testCoreProject_NewSampleB(monkeypatch, fncDir, tmpConf, mockGUI, tmpDir):
|
||||
theProject = NWProject(mockGUI)
|
||||
theProject.projTree.setSeed(42)
|
||||
|
||||
# Make sure we do not pick up the nw/assets/sample.zip file
|
||||
# Make sure we do not pick up the novelwriter/assets/sample.zip file
|
||||
tmpConf.assetPath = tmpDir
|
||||
|
||||
# Set a fake project file name
|
||||
@@ -531,7 +531,7 @@ def testCoreProject_LockFile(monkeypatch, fncDir, mockGUI):
|
||||
|
||||
# Write lock file
|
||||
with monkeypatch.context() as mp:
|
||||
mp.setattr("nw.core.project.time", lambda: 123.4)
|
||||
mp.setattr("novelwriter.core.project.time", lambda: 123.4)
|
||||
assert theProject._writeLockFile() is True
|
||||
assert readFile(lockFile) == "TestHost\nTestOS\n1.0\n123\n"
|
||||
|
||||
@@ -730,7 +730,7 @@ def testCoreProject_Methods(monkeypatch, nwMinimal, mockGUI, tmpDir):
|
||||
theProject.editTime = 1234
|
||||
theProject.projOpened = 1600000000
|
||||
with monkeypatch.context() as mp:
|
||||
mp.setattr("nw.core.project.time", lambda: 1600005600)
|
||||
mp.setattr("novelwriter.core.project.time", lambda: 1600005600)
|
||||
assert theProject.getCurrentEditTime() == 6834
|
||||
|
||||
# Trash folder
|
||||
@@ -892,7 +892,7 @@ def testCoreProject_Methods(monkeypatch, nwMinimal, mockGUI, tmpDir):
|
||||
theProject.notesWCount = 100
|
||||
|
||||
with monkeypatch.context() as mp:
|
||||
mp.setattr("nw.core.project.time", lambda: 1600005600)
|
||||
mp.setattr("novelwriter.core.project.time", lambda: 1600005600)
|
||||
assert theProject._appendSessionStats(idleTime=99)
|
||||
|
||||
assert readFile(statsFile) == (
|
||||
|
||||
@@ -26,7 +26,9 @@ import pytest
|
||||
from mock import causeOSError
|
||||
from tools import readFile, writeFile
|
||||
|
||||
from nw.core.spellcheck import NWSpellCheck, NWSpellEnchant, NWSpellSimple
|
||||
from novelwriter.core.spellcheck import (
|
||||
NWSpellCheck, NWSpellEnchant, NWSpellSimple
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.core
|
||||
|
||||
@@ -23,7 +23,7 @@ import pytest
|
||||
|
||||
from lxml import etree
|
||||
|
||||
from nw.core.status import NWStatus
|
||||
from novelwriter.core.status import NWStatus
|
||||
|
||||
|
||||
@pytest.mark.core
|
||||
|
||||
@@ -24,7 +24,7 @@ import pytest
|
||||
|
||||
from tools import readFile
|
||||
|
||||
from nw.core import NWProject, NWIndex, ToHtml
|
||||
from novelwriter.core import NWProject, NWIndex, ToHtml
|
||||
|
||||
|
||||
@pytest.mark.core
|
||||
|
||||
@@ -24,8 +24,8 @@ import pytest
|
||||
|
||||
from tools import readFile
|
||||
|
||||
from nw.core import NWProject, NWDoc
|
||||
from nw.core.tokenizer import Tokenizer
|
||||
from novelwriter.core import NWProject, NWDoc
|
||||
from novelwriter.core.tokenizer import Tokenizer
|
||||
|
||||
|
||||
@pytest.mark.core
|
||||
@@ -183,7 +183,7 @@ def testCoreToken_TextOps(monkeypatch, nwMinimal, mockGUI):
|
||||
assert theToken.theText == docText
|
||||
|
||||
with monkeypatch.context() as mp:
|
||||
mp.setattr("nw.constants.nwConst.MAX_DOCSIZE", 100)
|
||||
mp.setattr("novelwriter.constants.nwConst.MAX_DOCSIZE", 100)
|
||||
assert theToken.setText(sHandle, docText) is True
|
||||
assert theToken.theText == (
|
||||
"# ERROR\n\n"
|
||||
|
||||
@@ -28,8 +28,8 @@ from shutil import copyfile
|
||||
|
||||
from tools import cmpFiles
|
||||
|
||||
from nw.core import NWProject, NWIndex, ToOdt
|
||||
from nw.core.toodt import ODTParagraphStyle, ODTTextStyle, XMLParagraph, _mkTag
|
||||
from novelwriter.core import NWProject, NWIndex, ToOdt
|
||||
from novelwriter.core.toodt import ODTParagraphStyle, ODTTextStyle, XMLParagraph, _mkTag
|
||||
|
||||
XML_NS = [
|
||||
' xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"',
|
||||
|
||||
@@ -27,9 +27,9 @@ from hashlib import sha256
|
||||
|
||||
from tools import readFile
|
||||
|
||||
from nw.core.project import NWProject, NWItem, NWTree
|
||||
from nw.enum import nwItemClass, nwItemType, nwItemLayout
|
||||
from nw.constants import nwFiles
|
||||
from novelwriter.core.project import NWProject, NWItem, NWTree
|
||||
from novelwriter.enum import nwItemClass, nwItemType, nwItemLayout
|
||||
from novelwriter.constants import nwFiles
|
||||
|
||||
|
||||
@pytest.fixture(scope="function")
|
||||
@@ -283,7 +283,7 @@ def testCoreTree_MakeHandles(monkeypatch, mockGUI):
|
||||
# Fix the time() function and force a handle collission
|
||||
theTree.setSeed(None)
|
||||
theTree._handleCount = 0
|
||||
monkeypatch.setattr("nw.core.tree.time", lambda: 123.4)
|
||||
monkeypatch.setattr("novelwriter.core.tree.time", lambda: 123.4)
|
||||
|
||||
tHandle = theTree._makeHandle()
|
||||
theTree._projTree[tHandle] = None
|
||||
|
||||
Reference in New Issue
Block a user