Add some more unicode constants and rename thin non-breaking space variable
This commit is contained in:
+3
-3
@@ -152,11 +152,11 @@ def formatInt(theInt):
|
|||||||
theVal /= 1000.0
|
theVal /= 1000.0
|
||||||
if theVal < 1000.0:
|
if theVal < 1000.0:
|
||||||
if theVal < 10.0:
|
if theVal < 10.0:
|
||||||
return f"{theVal:4.2f}{nwUnicode.U_THNSP}{pF}"
|
return f"{theVal:4.2f}{nwUnicode.U_THSP}{pF}"
|
||||||
elif theVal < 100.0:
|
elif theVal < 100.0:
|
||||||
return f"{theVal:4.1f}{nwUnicode.U_THNSP}{pF}"
|
return f"{theVal:4.1f}{nwUnicode.U_THSP}{pF}"
|
||||||
else:
|
else:
|
||||||
return f"{theVal:3.0f}{nwUnicode.U_THNSP}{pF}"
|
return f"{theVal:3.0f}{nwUnicode.U_THSP}{pF}"
|
||||||
|
|
||||||
return str(theInt)
|
return str(theInt)
|
||||||
|
|
||||||
|
|||||||
@@ -241,7 +241,7 @@ class nwQuotes():
|
|||||||
# END Class nwQuotes
|
# END Class nwQuotes
|
||||||
|
|
||||||
class nwUnicode:
|
class nwUnicode:
|
||||||
"""Supported unicode character constants and translation maps for HTML.
|
"""Supported unicode character constants and their HTML equivalents.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Unicode Constants
|
# Unicode Constants
|
||||||
@@ -276,8 +276,10 @@ class nwUnicode:
|
|||||||
|
|
||||||
## Spaces and Lines
|
## Spaces and Lines
|
||||||
U_NBSP = "\u00a0" # Non-breaking space
|
U_NBSP = "\u00a0" # Non-breaking space
|
||||||
U_THNSP = "\u2009" # Thin space
|
U_THSP = "\u2009" # Thin space
|
||||||
U_THNBSP = "\u202f" # Thin non-breaking space
|
U_THNBSP = "\u202f" # Thin non-breaking space
|
||||||
|
U_ENSP = "\u2002" # Short (en) space
|
||||||
|
U_EMSP = "\u2003" # Long (em) space
|
||||||
U_LSEP = "\u2028" # Line separator
|
U_LSEP = "\u2028" # Line separator
|
||||||
U_PSEP = "\u2029" # Paragraph separator
|
U_PSEP = "\u2029" # Paragraph separator
|
||||||
|
|
||||||
@@ -328,8 +330,10 @@ class nwUnicode:
|
|||||||
|
|
||||||
## Spaces
|
## Spaces
|
||||||
H_NBSP = " "
|
H_NBSP = " "
|
||||||
H_THNSP = " "
|
H_THSP = " "
|
||||||
H_THNBSP = " "
|
H_THNBSP = " "
|
||||||
|
H_ENSP = " "
|
||||||
|
H_EMSP = " "
|
||||||
|
|
||||||
## Symbols
|
## Symbols
|
||||||
H_CHECK = "✔"
|
H_CHECK = "✔"
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ class ToHtml(Tokenizer):
|
|||||||
nwUnicode.U_EMDASH : nwUnicode.H_EMDASH,
|
nwUnicode.U_EMDASH : nwUnicode.H_EMDASH,
|
||||||
nwUnicode.U_HELLIP : nwUnicode.H_HELLIP,
|
nwUnicode.U_HELLIP : nwUnicode.H_HELLIP,
|
||||||
nwUnicode.U_NBSP : nwUnicode.H_NBSP,
|
nwUnicode.U_NBSP : nwUnicode.H_NBSP,
|
||||||
nwUnicode.U_THNSP : nwUnicode.H_THNSP,
|
nwUnicode.U_THSP : nwUnicode.H_THSP,
|
||||||
nwUnicode.U_THNBSP : nwUnicode.H_THNBSP,
|
nwUnicode.U_THNBSP : nwUnicode.H_THNBSP,
|
||||||
nwUnicode.U_MAPOSS : nwUnicode.H_RSQUO,
|
nwUnicode.U_MAPOSS : nwUnicode.H_RSQUO,
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -734,7 +734,7 @@ class GuiDocEditor(QTextEdit):
|
|||||||
elif theInsert == nwDocInsert.NB_SPACE:
|
elif theInsert == nwDocInsert.NB_SPACE:
|
||||||
theText = nwUnicode.U_NBSP
|
theText = nwUnicode.U_NBSP
|
||||||
elif theInsert == nwDocInsert.THIN_SPACE:
|
elif theInsert == nwDocInsert.THIN_SPACE:
|
||||||
theText = nwUnicode.U_THNSP
|
theText = nwUnicode.U_THSP
|
||||||
elif theInsert == nwDocInsert.THIN_NB_SPACE:
|
elif theInsert == nwDocInsert.THIN_NB_SPACE:
|
||||||
theText = nwUnicode.U_THNBSP
|
theText = nwUnicode.U_THNBSP
|
||||||
elif theInsert == nwDocInsert.SHORT_DASH:
|
elif theInsert == nwDocInsert.SHORT_DASH:
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ def testGuiMenu_Insert(qtbot, monkeypatch, nwGUI, fncDir, fncProj):
|
|||||||
nwGUI.docEditor.clear()
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
nwGUI.mainMenu.aInsThinSpace.activate(QAction.Trigger)
|
nwGUI.mainMenu.aInsThinSpace.activate(QAction.Trigger)
|
||||||
assert nwGUI.docEditor.getText() == nwUnicode.U_THNSP
|
assert nwGUI.docEditor.getText() == nwUnicode.U_THSP
|
||||||
nwGUI.docEditor.clear()
|
nwGUI.docEditor.clear()
|
||||||
|
|
||||||
nwGUI.mainMenu.aInsThinNBSpace.activate(QAction.Trigger)
|
nwGUI.mainMenu.aInsThinNBSpace.activate(QAction.Trigger)
|
||||||
|
|||||||
Reference in New Issue
Block a user