mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-17 17:34:35 +08:00
simply the logic
This commit is contained in:
@@ -211,14 +211,11 @@ class QlibConfig(Config):
|
|||||||
self["provider_uri"] = str(Path(self["provider_uri"]).expanduser().resolve())
|
self["provider_uri"] = str(Path(self["provider_uri"]).expanduser().resolve())
|
||||||
|
|
||||||
def get_uri_type(self):
|
def get_uri_type(self):
|
||||||
win_rm = re.match("^[a-zA-Z]:.*", self["provider_uri"])
|
is_win = re.match("^[a-zA-Z]:.*", self["provider_uri"]) is not None # such as 'C:\\data', 'D:'
|
||||||
nfs_or_win_rm = re.match("^[^/]+:.+", self["provider_uri"])
|
is_nfs_or_win = re.match("^[^/]+:.+", self["provider_uri"]) is not None # such as 'host:/data/' (User may define short hostname by themselves or use localhost)
|
||||||
# Windows path is "C:\\"
|
|
||||||
if win_rm is None:
|
if is_nfs_or_win and not is_win:
|
||||||
if nfs_or_win_rm is None:
|
return QlibConfig.NFS_URI
|
||||||
return QlibConfig.LOCAL_URI
|
|
||||||
else:
|
|
||||||
return QlibConfig.NFS_URI
|
|
||||||
else:
|
else:
|
||||||
return QlibConfig.LOCAL_URI
|
return QlibConfig.LOCAL_URI
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user