mirror of https://github.com/coqui-ai/TTS.git
Add customizable data home path (#2871)
* Add customizable data home path * Add TTS_HOME as an option
This commit is contained in:
parent
c4e5effab9
commit
febcaf710a
|
@ -126,7 +126,13 @@ def get_import_path(obj: object) -> str:
|
|||
|
||||
|
||||
def get_user_data_dir(appname):
|
||||
if sys.platform == "win32":
|
||||
TTS_HOME = os.environ.get("TTS_HOME")
|
||||
XDG_DATA_HOME = os.environ.get("XDG_DATA_HOME")
|
||||
if TTS_HOME is not None:
|
||||
ans = Path(TTS_HOME).expanduser().resolve(strict=False)
|
||||
elif XDG_DATA_HOME is not None:
|
||||
ans = Path(XDG_DATA_HOME).expanduser().resolve(strict=False)
|
||||
elif sys.platform == "win32":
|
||||
import winreg # pylint: disable=import-outside-toplevel
|
||||
|
||||
key = winreg.OpenKey(
|
||||
|
|
Loading…
Reference in New Issue