1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-10 14:26:56 +08:00

Fix C.provider_uri

This commit is contained in:
zhupr
2020-09-30 16:10:28 +08:00
committed by you-n-g
parent 9637dc540e
commit 1f23eb9a30
2 changed files with 7 additions and 3 deletions

View File

@@ -207,14 +207,15 @@ class QlibConfig(Config):
def resolve_path(self):
# resolve path
if self["mount_path"] is not None:
self["mount_path"]= str(Path(self["mount_path"]).expanduser().resolve())
self["mount_path"] = str(Path(self["mount_path"]).expanduser().resolve())
if self.get_uri_type() == QlibConfig.LOCAL_URI:
self["provider_uri"] = str(Path(self["provider_uri"]).expanduser().resolve())
def get_uri_type(self):
rm = re.match("^[^/ ]+:.+", self["provider_uri"])
if rm is None:
# Windows path is "C:\\"
if rm is None or Path(self["provider_uri"]).exists():
return QlibConfig.LOCAL_URI
else:
return QlibConfig.NFS_URI