snake case for addon_schema

This commit is contained in:
Arthur Milchior 2020-03-11 00:56:14 +01:00
parent 131d37dca5
commit 0b04da6419

View file

@ -601,11 +601,11 @@ and have been disabled: %(found)s"
# Schema # Schema
###################################################################### ######################################################################
def _addonSchemaPath(self, dir): def _addon_schema_path(self, dir):
return os.path.join(self.addonsFolder(dir), "config.schema.json") return os.path.join(self.addonsFolder(dir), "config.schema.json")
def _addonSchema(self, dir): def _addon_schema(self, dir):
path = self._addonSchemaPath(dir) path = self._addon_schema_path(dir)
try: try:
if not os.path.exists(path): if not os.path.exists(path):
# True is a schema accepting everything # True is a schema accepting everything
@ -1328,7 +1328,7 @@ class ConfigEditor(QDialog):
txt = gui_hooks.addon_config_editor_will_save_json(txt) txt = gui_hooks.addon_config_editor_will_save_json(txt)
try: try:
new_conf = json.loads(txt) new_conf = json.loads(txt)
jsonschema.validate(new_conf, self.parent().mgr._addonSchema(self.addon)) jsonschema.validate(new_conf, self.parent().mgr._addon_schema(self.addon))
except ValidationError as e: except ValidationError as e:
# The user did edit the configuration and entered a value # The user did edit the configuration and entered a value
# which can not be interpreted. # which can not be interpreted.