Disable config parser interpolation with % (#2455)
This commit is contained in:
@@ -680,11 +680,12 @@ class NWConfigParser(ConfigParser):
|
|||||||
"""Common: Adapted Config Parser
|
"""Common: Adapted Config Parser
|
||||||
|
|
||||||
This is a subclass of the standard config parser that adds type safe
|
This is a subclass of the standard config parser that adds type safe
|
||||||
helper functions, and support for lists.
|
helper functions, and support for lists. It also turns off
|
||||||
|
interpolation, which would require % symbols to be escaped (#2455).
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
super().__init__()
|
super().__init__(interpolation=None)
|
||||||
return
|
return
|
||||||
|
|
||||||
def rdStr(self, section: str, option: str, default: str) -> str:
|
def rdStr(self, section: str, option: str, default: str) -> str:
|
||||||
|
|||||||
@@ -271,8 +271,8 @@ def testDlgPreferences_Settings(qtbot, monkeypatch, nwGUI, fncPath, tstPaths):
|
|||||||
prefs.dialogLine.setText("–")
|
prefs.dialogLine.setText("–")
|
||||||
prefs.narratorBreak.setCurrentData("–", "")
|
prefs.narratorBreak.setCurrentData("–", "")
|
||||||
prefs.narratorDialog.setCurrentData("–", "")
|
prefs.narratorDialog.setCurrentData("–", "")
|
||||||
prefs.altDialogOpen.setText("<")
|
prefs.altDialogOpen.setText("%") # Symbol also tests for #2455
|
||||||
prefs.altDialogClose.setText(">")
|
prefs.altDialogClose.setText("%") # Symbol also tests for #2455
|
||||||
prefs.highlightEmph.setChecked(False)
|
prefs.highlightEmph.setChecked(False)
|
||||||
prefs.showMultiSpaces.setChecked(False)
|
prefs.showMultiSpaces.setChecked(False)
|
||||||
|
|
||||||
@@ -401,8 +401,8 @@ def testDlgPreferences_Settings(qtbot, monkeypatch, nwGUI, fncPath, tstPaths):
|
|||||||
assert CONFIG.dialogLine == "–"
|
assert CONFIG.dialogLine == "–"
|
||||||
assert CONFIG.narratorBreak == "–"
|
assert CONFIG.narratorBreak == "–"
|
||||||
assert CONFIG.narratorDialog == "–"
|
assert CONFIG.narratorDialog == "–"
|
||||||
assert CONFIG.altDialogOpen == "<"
|
assert CONFIG.altDialogOpen == "%"
|
||||||
assert CONFIG.altDialogClose == ">"
|
assert CONFIG.altDialogClose == "%"
|
||||||
assert CONFIG.highlightEmph is False
|
assert CONFIG.highlightEmph is False
|
||||||
assert CONFIG.showMultiSpaces is False
|
assert CONFIG.showMultiSpaces is False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user