Remove titleFormat from project XML and rename mock test file
This commit is contained in:
@@ -170,11 +170,6 @@ class NWProjectData:
|
||||
"""Return the autoreplace dictionary."""
|
||||
return self._autoReplace
|
||||
|
||||
@property
|
||||
def titleFormat(self):
|
||||
"""Delete"""
|
||||
return self._titleFormat
|
||||
|
||||
@property
|
||||
def itemStatus(self) -> NWStatus:
|
||||
"""Return the status settings object."""
|
||||
@@ -209,10 +204,6 @@ class NWProjectData:
|
||||
"""Retrieve the last used handle for a given component."""
|
||||
return self._lastHandle.get(component, None)
|
||||
|
||||
def getTitleFormat(self, kind):
|
||||
"""Retrieve the title format string for a given kind of header."""
|
||||
return self._titleFormat.get(kind, "%title%")
|
||||
|
||||
##
|
||||
# Setters
|
||||
##
|
||||
@@ -337,13 +328,4 @@ class NWProjectData:
|
||||
self.theProject.setProjectChanged(True)
|
||||
return
|
||||
|
||||
def setTitleFormat(self, value):
|
||||
"""Set the title formats."""
|
||||
if isinstance(value, dict):
|
||||
for key, entry in value.items():
|
||||
if key in self._titleFormat and isinstance(entry, str):
|
||||
self._titleFormat[key] = simplified(entry)
|
||||
self.theProject.setProjectChanged(True)
|
||||
return
|
||||
|
||||
# END Class NWProjectData
|
||||
|
||||
@@ -280,11 +280,6 @@ class ProjectXMLReader:
|
||||
data.setAutoReplace(self._parseDictKeyText(xItem))
|
||||
else: # Pre 1.2 format
|
||||
data.setAutoReplace(self._parseDictTagText(xItem))
|
||||
elif xItem.tag == "titleFormat":
|
||||
if self._version >= 0x0105:
|
||||
data.setTitleFormat(self._parseDictKeyText(xItem))
|
||||
else: # Pre 1.4 format
|
||||
data.setTitleFormat(self._parseDictTagText(xItem))
|
||||
else:
|
||||
logger.warning("Ignored <root/settings/%s> in XML", xItem.tag)
|
||||
|
||||
@@ -523,7 +518,6 @@ class ProjectXMLWriter:
|
||||
})
|
||||
self._packDictKeyValue(xSettings, "lastHandle", data.lastHandle)
|
||||
self._packDictKeyValue(xSettings, "autoReplace", data.autoReplace)
|
||||
self._packDictKeyValue(xSettings, "titleFormat", data.titleFormat)
|
||||
|
||||
# Save Status/Importance
|
||||
xStatus = ET.SubElement(xSettings, "status")
|
||||
|
||||
Reference in New Issue
Block a user