Fiexd more formatting errors
This commit is contained in:
@@ -76,6 +76,7 @@ logging.addLevelName(VERBOSE, "VERBOSE")
|
|||||||
def logVerbose(self, message, *args, **kws):
|
def logVerbose(self, message, *args, **kws):
|
||||||
if self.isEnabledFor(VERBOSE):
|
if self.isEnabledFor(VERBOSE):
|
||||||
self._log(VERBOSE, message, args, **kws)
|
self._log(VERBOSE, message, args, **kws)
|
||||||
|
|
||||||
logging.Logger.verbose = logVerbose
|
logging.Logger.verbose = logVerbose
|
||||||
|
|
||||||
# Initiating logging
|
# Initiating logging
|
||||||
|
|||||||
+8
-7
@@ -206,14 +206,14 @@ class NWProject():
|
|||||||
self.autoOutline = True
|
self.autoOutline = True
|
||||||
self.statusItems = NWStatus()
|
self.statusItems = NWStatus()
|
||||||
self.statusItems.addEntry("New", (100, 100, 100))
|
self.statusItems.addEntry("New", (100, 100, 100))
|
||||||
self.statusItems.addEntry("Note", (200, 50, 0))
|
self.statusItems.addEntry("Note", (200, 50, 0))
|
||||||
self.statusItems.addEntry("Draft", (200, 150, 0))
|
self.statusItems.addEntry("Draft", (200, 150, 0))
|
||||||
self.statusItems.addEntry("Finished", ( 50, 200, 0))
|
self.statusItems.addEntry("Finished", (50, 200, 0))
|
||||||
self.importItems = NWStatus()
|
self.importItems = NWStatus()
|
||||||
self.importItems.addEntry("New", (100, 100, 100))
|
self.importItems.addEntry("New", (100, 100, 100))
|
||||||
self.importItems.addEntry("Minor", (200, 50, 0))
|
self.importItems.addEntry("Minor", (200, 50, 0))
|
||||||
self.importItems.addEntry("Major", (200, 150, 0))
|
self.importItems.addEntry("Major", (200, 150, 0))
|
||||||
self.importItems.addEntry("Main", ( 50, 200, 0))
|
self.importItems.addEntry("Main", (50, 200, 0))
|
||||||
self.lastEdited = None
|
self.lastEdited = None
|
||||||
self.lastViewed = None
|
self.lastViewed = None
|
||||||
self.lastWCount = 0
|
self.lastWCount = 0
|
||||||
@@ -1402,7 +1402,8 @@ class NWProject():
|
|||||||
try:
|
try:
|
||||||
rmdir(theData)
|
rmdir(theData)
|
||||||
logger.info("Removed folder: %s" % theFolder)
|
logger.info("Removed folder: %s" % theFolder)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
|
logger.error(str(e))
|
||||||
errList.append("Failed to remove: %s" % theFolder)
|
errList.append("Failed to remove: %s" % theFolder)
|
||||||
|
|
||||||
return errList
|
return errList
|
||||||
|
|||||||
+23
-23
@@ -40,34 +40,34 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
class Tokenizer():
|
class Tokenizer():
|
||||||
|
|
||||||
FMT_B_B = 1 # Begin bold
|
FMT_B_B = 1 # Begin bold
|
||||||
FMT_B_E = 2 # End bold
|
FMT_B_E = 2 # End bold
|
||||||
FMT_I_B = 3 # Begin italics
|
FMT_I_B = 3 # Begin italics
|
||||||
FMT_I_E = 4 # End italics
|
FMT_I_E = 4 # End italics
|
||||||
FMT_D_B = 5 # Begin strikeout
|
FMT_D_B = 5 # Begin strikeout
|
||||||
FMT_D_E = 6 # End strikeout
|
FMT_D_E = 6 # End strikeout
|
||||||
|
|
||||||
T_EMPTY = 1 # Empty line (new paragraph)
|
T_EMPTY = 1 # Empty line (new paragraph)
|
||||||
T_SYNOPSIS = 2 # Synopsis comment
|
T_SYNOPSIS = 2 # Synopsis comment
|
||||||
T_COMMENT = 3 # Comment line
|
T_COMMENT = 3 # Comment line
|
||||||
T_KEYWORD = 4 # Command line
|
T_KEYWORD = 4 # Command line
|
||||||
T_TITLE = 5 # Title
|
T_TITLE = 5 # Title
|
||||||
T_HEAD1 = 6 # Header 1
|
T_HEAD1 = 6 # Header 1
|
||||||
T_HEAD2 = 7 # Header 2
|
T_HEAD2 = 7 # Header 2
|
||||||
T_HEAD3 = 8 # Header 3
|
T_HEAD3 = 8 # Header 3
|
||||||
T_HEAD4 = 9 # Header 4
|
T_HEAD4 = 9 # Header 4
|
||||||
T_TEXT = 10 # Text line
|
T_TEXT = 10 # Text line
|
||||||
T_SEP = 11 # Scene separator
|
T_SEP = 11 # Scene separator
|
||||||
T_SKIP = 12 # Paragraph break
|
T_SKIP = 12 # Paragraph break
|
||||||
|
|
||||||
A_NONE = 0 # No special style
|
A_NONE = 0 # No special style
|
||||||
A_LEFT = 1 # Left aligned
|
A_LEFT = 1 # Left aligned
|
||||||
A_RIGHT = 2 # Right aligned
|
A_RIGHT = 2 # Right aligned
|
||||||
A_CENTRE = 4 # Centred
|
A_CENTRE = 4 # Centred
|
||||||
A_JUSTIFY = 8 # Justified
|
A_JUSTIFY = 8 # Justified
|
||||||
A_PBB = 16 # Page break before always
|
A_PBB = 16 # Page break before always
|
||||||
A_PBB_AV = 32 # Page break before avoid
|
A_PBB_AV = 32 # Page break before avoid
|
||||||
A_PBB_NO = 64 # Page break before never
|
A_PBB_NO = 64 # Page break before never
|
||||||
A_PBA = 128 # Page break after always
|
A_PBA = 128 # Page break after always
|
||||||
A_PBA_AV = 256 # Page break after avoid
|
A_PBA_AV = 256 # Page break after avoid
|
||||||
A_PBA_NO = 512 # Page break after avoid
|
A_PBA_NO = 512 # Page break after avoid
|
||||||
|
|||||||
+2
-2
@@ -153,7 +153,7 @@ class NWTree():
|
|||||||
outFile.write(" Table of Contents\n")
|
outFile.write(" Table of Contents\n")
|
||||||
outFile.write("===================\n")
|
outFile.write("===================\n")
|
||||||
outFile.write("\n")
|
outFile.write("\n")
|
||||||
outFile.write(" %-25s %-9s %s\n" %("File Name", "Class", "Document Label"))
|
outFile.write(" %-25s %-9s %s\n" % ("File Name", "Class", "Document Label"))
|
||||||
outFile.write("-"*80+"\n")
|
outFile.write("-"*80+"\n")
|
||||||
for tHandle in sorted(self._treeOrder):
|
for tHandle in sorted(self._treeOrder):
|
||||||
tItem = self.__getitem__(tHandle)
|
tItem = self.__getitem__(tHandle)
|
||||||
@@ -161,7 +161,7 @@ class NWTree():
|
|||||||
continue
|
continue
|
||||||
tFile = tHandle+".nwd"
|
tFile = tHandle+".nwd"
|
||||||
if path.isfile(path.join(self.theProject.projContent, tFile)):
|
if path.isfile(path.join(self.theProject.projContent, tFile)):
|
||||||
outFile.write(" %-25s %-9s %s\n" %(
|
outFile.write(" %-25s %-9s %s\n" % (
|
||||||
path.join("content", tFile),
|
path.join("content", tFile),
|
||||||
tItem.itemClass.name,
|
tItem.itemClass.name,
|
||||||
tItem.itemName,
|
tItem.itemName,
|
||||||
|
|||||||
@@ -1068,7 +1068,6 @@ class GuiBuildNovelDocView(QTextBrowser):
|
|||||||
strBuildTime = "Unknown"
|
strBuildTime = "Unknown"
|
||||||
self.theTitle.setText("<b>Build Time:</b> %s" % strBuildTime)
|
self.theTitle.setText("<b>Build Time:</b> %s" % strBuildTime)
|
||||||
|
|
||||||
|
|
||||||
def _updateDocMargins(self):
|
def _updateDocMargins(self):
|
||||||
"""Automatically adjust the header to fill the top of the
|
"""Automatically adjust the header to fill the top of the
|
||||||
document within the viewport.
|
document within the viewport.
|
||||||
|
|||||||
@@ -101,17 +101,17 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
|||||||
self.colEmph = None
|
self.colEmph = None
|
||||||
|
|
||||||
self.hStyles = {
|
self.hStyles = {
|
||||||
"header1" : self._makeFormat(self.colHead, "bold", 1.8),
|
"header1" : self._makeFormat(self.colHead, "bold", 1.8),
|
||||||
"header2" : self._makeFormat(self.colHead, "bold", 1.6),
|
"header2" : self._makeFormat(self.colHead, "bold", 1.6),
|
||||||
"header3" : self._makeFormat(self.colHead, "bold", 1.4),
|
"header3" : self._makeFormat(self.colHead, "bold", 1.4),
|
||||||
"header4" : self._makeFormat(self.colHead, "bold", 1.2),
|
"header4" : self._makeFormat(self.colHead, "bold", 1.2),
|
||||||
"header1h" : self._makeFormat(self.colHeadH, "bold", 1.8),
|
"header1h" : self._makeFormat(self.colHeadH, "bold", 1.8),
|
||||||
"header2h" : self._makeFormat(self.colHeadH, "bold", 1.6),
|
"header2h" : self._makeFormat(self.colHeadH, "bold", 1.6),
|
||||||
"header3h" : self._makeFormat(self.colHeadH, "bold", 1.4),
|
"header3h" : self._makeFormat(self.colHeadH, "bold", 1.4),
|
||||||
"header4h" : self._makeFormat(self.colHeadH, "bold", 1.2),
|
"header4h" : self._makeFormat(self.colHeadH, "bold", 1.2),
|
||||||
"bold" : self._makeFormat(self.colEmph, "bold"),
|
"bold" : self._makeFormat(self.colEmph, "bold"),
|
||||||
"italic" : self._makeFormat(self.colEmph, "italic"),
|
"italic" : self._makeFormat(self.colEmph, "italic"),
|
||||||
"strike" : self._makeFormat(self.colEmph, "strike"),
|
"strike" : self._makeFormat(self.colEmph, "strike"),
|
||||||
"trailing" : self._makeFormat(self.colTrail, "background"),
|
"trailing" : self._makeFormat(self.colTrail, "background"),
|
||||||
"nobreak" : self._makeFormat(self.colTrail, "background"),
|
"nobreak" : self._makeFormat(self.colTrail, "background"),
|
||||||
"dialogue1" : self._makeFormat(self.colDialN),
|
"dialogue1" : self._makeFormat(self.colDialN),
|
||||||
@@ -121,7 +121,7 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
|||||||
"hidden" : self._makeFormat(self.colComm),
|
"hidden" : self._makeFormat(self.colComm),
|
||||||
"keyword" : self._makeFormat(self.colKey),
|
"keyword" : self._makeFormat(self.colKey),
|
||||||
"modifier" : self._makeFormat(self.colMod),
|
"modifier" : self._makeFormat(self.colMod),
|
||||||
"value" : self._makeFormat(self.colVal, "underline"),
|
"value" : self._makeFormat(self.colVal, "underline"),
|
||||||
}
|
}
|
||||||
|
|
||||||
self.hRules = []
|
self.hRules = []
|
||||||
|
|||||||
+5
-5
@@ -43,12 +43,12 @@ class GuiOutline(QTreeWidget):
|
|||||||
|
|
||||||
DEF_WIDTH = {
|
DEF_WIDTH = {
|
||||||
nwOutline.TITLE : 200,
|
nwOutline.TITLE : 200,
|
||||||
nwOutline.LEVEL : 40,
|
nwOutline.LEVEL : 40,
|
||||||
nwOutline.LABEL : 150,
|
nwOutline.LABEL : 150,
|
||||||
nwOutline.LINE : 40,
|
nwOutline.LINE : 40,
|
||||||
nwOutline.CCOUNT : 50,
|
nwOutline.CCOUNT : 50,
|
||||||
nwOutline.WCOUNT : 50,
|
nwOutline.WCOUNT : 50,
|
||||||
nwOutline.PCOUNT : 50,
|
nwOutline.PCOUNT : 50,
|
||||||
nwOutline.POV : 100,
|
nwOutline.POV : 100,
|
||||||
nwOutline.CHAR : 100,
|
nwOutline.CHAR : 100,
|
||||||
nwOutline.PLOT : 100,
|
nwOutline.PLOT : 100,
|
||||||
|
|||||||
+27
-27
@@ -77,11 +77,11 @@ class GuiTheme:
|
|||||||
self.themeLicenseUrl = ""
|
self.themeLicenseUrl = ""
|
||||||
|
|
||||||
## GUI
|
## GUI
|
||||||
self.treeWCount = [ 0, 0, 0]
|
self.treeWCount = [0, 0, 0]
|
||||||
self.statNone = [120, 120, 120]
|
self.statNone = [120, 120, 120]
|
||||||
self.statUnsaved = [120, 120, 40]
|
self.statUnsaved = [120, 120, 40]
|
||||||
self.statSaved = [ 40, 120, 0]
|
self.statSaved = [40, 120, 0]
|
||||||
self.helpText = [ 0, 0, 0]
|
self.helpText = [0, 0, 0]
|
||||||
|
|
||||||
# Loaded Syntax Settings
|
# Loaded Syntax Settings
|
||||||
|
|
||||||
@@ -96,21 +96,21 @@ class GuiTheme:
|
|||||||
|
|
||||||
## Colours
|
## Colours
|
||||||
self.colBack = [255, 255, 255]
|
self.colBack = [255, 255, 255]
|
||||||
self.colText = [ 0, 0, 0]
|
self.colText = [0, 0, 0]
|
||||||
self.colLink = [ 0, 0, 0]
|
self.colLink = [0, 0, 0]
|
||||||
self.colHead = [ 0, 0, 0]
|
self.colHead = [0, 0, 0]
|
||||||
self.colHeadH = [ 0, 0, 0]
|
self.colHeadH = [0, 0, 0]
|
||||||
self.colEmph = [ 0, 0, 0]
|
self.colEmph = [0, 0, 0]
|
||||||
self.colDialN = [ 0, 0, 0]
|
self.colDialN = [0, 0, 0]
|
||||||
self.colDialD = [ 0, 0, 0]
|
self.colDialD = [0, 0, 0]
|
||||||
self.colDialS = [ 0, 0, 0]
|
self.colDialS = [0, 0, 0]
|
||||||
self.colComm = [ 0, 0, 0]
|
self.colComm = [0, 0, 0]
|
||||||
self.colKey = [ 0, 0, 0]
|
self.colKey = [0, 0, 0]
|
||||||
self.colVal = [ 0, 0, 0]
|
self.colVal = [0, 0, 0]
|
||||||
self.colSpell = [ 0, 0, 0]
|
self.colSpell = [0, 0, 0]
|
||||||
self.colTagErr = [ 0, 0, 0]
|
self.colTagErr = [0, 0, 0]
|
||||||
self.colRepTag = [ 0, 0, 0]
|
self.colRepTag = [0, 0, 0]
|
||||||
self.colMod = [ 0, 0, 0]
|
self.colMod = [0, 0, 0]
|
||||||
|
|
||||||
# Changeable Settings
|
# Changeable Settings
|
||||||
self.guiTheme = None
|
self.guiTheme = None
|
||||||
@@ -146,7 +146,7 @@ class GuiTheme:
|
|||||||
self.fontPixelSize = int(round(qMetric.height()))
|
self.fontPixelSize = int(round(qMetric.height()))
|
||||||
self.baseIconSize = int(round(qMetric.ascent()))
|
self.baseIconSize = int(round(qMetric.ascent()))
|
||||||
self.textNHeight = qMetric.boundingRect("N").height()
|
self.textNHeight = qMetric.boundingRect("N").height()
|
||||||
self.textNWidth= qMetric.boundingRect("N").width()
|
self.textNWidth = qMetric.boundingRect("N").width()
|
||||||
|
|
||||||
logger.verbose("GUI Font Family: %s" % self.guiFont.family())
|
logger.verbose("GUI Font Family: %s" % self.guiFont.family())
|
||||||
logger.verbose("GUI Font Point Size: %.2f" % self.fontPointSize)
|
logger.verbose("GUI Font Point Size: %.2f" % self.fontPointSize)
|
||||||
@@ -276,13 +276,13 @@ class GuiTheme:
|
|||||||
## Main
|
## Main
|
||||||
cnfSec = "Main"
|
cnfSec = "Main"
|
||||||
if confParser.has_section(cnfSec):
|
if confParser.has_section(cnfSec):
|
||||||
self.themeName = self._parseLine( confParser, cnfSec, "name", "")
|
self.themeName = self._parseLine(confParser, cnfSec, "name", "")
|
||||||
self.themeDescription = self._parseLine( confParser, cnfSec, "description", "")
|
self.themeDescription = self._parseLine(confParser, cnfSec, "description", "")
|
||||||
self.themeAuthor = self._parseLine( confParser, cnfSec, "author", "")
|
self.themeAuthor = self._parseLine(confParser, cnfSec, "author", "")
|
||||||
self.themeCredit = self._parseLine( confParser, cnfSec, "credit", "")
|
self.themeCredit = self._parseLine(confParser, cnfSec, "credit", "")
|
||||||
self.themeUrl = self._parseLine( confParser, cnfSec, "url", "")
|
self.themeUrl = self._parseLine(confParser, cnfSec, "url", "")
|
||||||
self.themeLicense = self._parseLine( confParser, cnfSec, "license", "")
|
self.themeLicense = self._parseLine(confParser, cnfSec, "license", "")
|
||||||
self.themeLicenseUrl = self._parseLine( confParser, cnfSec, "licenseurl", "")
|
self.themeLicenseUrl = self._parseLine(confParser, cnfSec, "licenseurl", "")
|
||||||
|
|
||||||
## Palette
|
## Palette
|
||||||
cnfSec = "Palette"
|
cnfSec = "Palette"
|
||||||
|
|||||||
Reference in New Issue
Block a user