Removing data_dir in favor of Extension.get_data_dir, #547
This commit is contained in:
@ -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):
|
||||
|
||||
@ -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:
|
||||
|
||||
Reference in New Issue
Block a user