Skip to content

Commit

Permalink
fix gdrive_url pytest error
Browse files Browse the repository at this point in the history
  • Loading branch information
HowcanoeWang committed Aug 19, 2024
1 parent aab916c commit 47c11ab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions easyidp/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def __init__(self, name="", gdrive_url="", size="",):
"""
self.name = name
self.grive_url = gdrive_url
self.gdrive_url = gdrive_url
self.size = size
self.data_dir = user_data_dir(self.name)
self.zip_file = user_data_dir(self.name + ".zip")
Expand Down Expand Up @@ -347,13 +347,13 @@ def _download_data(self):
import gdown
# google drive gdown_test.zip file is accessable
# then try according google drive download link
if url_checker(self.grive_url):
output = gdown.download(url=self.grive_url, output=str(self.zip_file), quiet=False, fuzzy=True)
if url_checker(self.gdrive_url):
output = gdown.download(url=self.gdrive_url, output=str(self.zip_file), quiet=False, fuzzy=True)
else:
# user can access Google Drive but maybe dataset zip file is missing, no waste AliYun OSS resource
# just mention user to double check google drive access
raise ConnectionError(
f"Could not access google download link for dataset {self.name} from: \n{self.grive_url}.\n"
f"Could not access google download link for dataset {self.name} from: \n{self.gdrive_url}.\n"
f"Please contact the maintainer via github if above link is broken."
)
else:
Expand Down

0 comments on commit 47c11ab

Please sign in to comment.