Removing data_dir in favor of Extension.get_data_dir, #547

This commit is contained in:
James Barnsley
2020-05-31 21:35:24 +12:00
parent fec4396583
commit d88f66798f
3 changed files with 4 additions and 3 deletions

View File

@ -30,7 +30,7 @@ class Extension(ext.Extension):
schema["spotify_authorization_url"] = config.String()
schema["lastfm_authorization_url"] = config.String()
schema["genius_authorization_url"] = config.String()
schema["data_dir"] = config.String()
schema["data_dir"] = config.String() # Deprecated
return schema
def setup(self, registry):

View File

@ -72,7 +72,7 @@ class IrisCore(pykka.ThreadingActor):
# @return Dict
##
def load_from_file(self, name):
file_path = Path(self.config["iris"]["data_dir"]) / ("%s.pkl" % name)
file_path = Extension.get_data_dir(self.config) / ("%s.pkl" % name)
try:
with file_path.open("rb") as f:
@ -90,7 +90,7 @@ class IrisCore(pykka.ThreadingActor):
# @return void
##
def save_to_file(self, dict, name):
file_path = Path(self.config["iris"]["data_dir"]) / ("%s.pkl" % name)
file_path = Extension.get_data_dir(self.config) / ("%s.pkl" % name)
try:
with file_path.open("wb") as f: