@Michael-Brock
Because you already using pythonscript plugin it might be helpful
to let a script like this
from Npp import notepad
from os import path
import xml.etree.ElementTree as et
from pprint import pformat
# <GUIConfig name="Backup" action="0" useCustumDir="no" dir="" isSnapshotMode="yes" snapshotBackupTiming="7000" />
expected_settings = {'name': "Backup",
'action': "0",
'useCustumDir': "no",
'dir': "",
'isSnapshotMode': "yes",
'snapshotBackupTiming': "7000",
}
plugin_config_dir = notepad.getPluginConfigDir()
npp_config_dir = path.join(plugin_config_dir, r'..\..')
config_xml = path.abspath(path.join(npp_config_dir, r'config.xml'))
if path.exists(config_xml):
xml_doc = et.parse(config_xml)
node = xml_doc.find('GUIConfigs/GUIConfig[@name="Backup"]')
current_settings = { x:y for x,y in node.items()}
if expected_settings != current_settings:
template = ('name == {name}\r\n'
'action == {action}\r\n'
'useCustumDir == {useCustumDir}\r\n'
'dir == {dir}\r\n'
'isSnapshotMode == {isSnapshotMode}\r\n'
'snapshotBackupTiming == {snapshotBackupTiming}\r\n')
current = template.format(**current_settings)
expected = template.format(**expected_settings)
notepad.messageBox(('Backup settings have been changed\r\n\r\n'
'expected:\r\n\r\n{0}\r\n\r\n'
'received:\r\n\r\n{1}').format(expected, current),
'BACKUP SETTINGS CHECK')
else:
notepad.messageBox(('Unable to find:\r\n\r\n{0}\r\n\r\n'
'Backup settings might be lost!').format(config_xml),
'BACKUP SETTINGS CHECK')
run on every npp startup. Put it in user startup.py and make sure
your configuration is set to ATSTARTUP then your expected
settings will be checked against current xml setting each time npp starts. Of course you need to adapt the expected settings to your need.