DiGyt commited on
Commit
4f646fd
1 Parent(s): 9945ae3

Change windows extraction method

Browse files
Files changed (1) hide show
  1. ecoset.py +11 -5
ecoset.py CHANGED
@@ -149,14 +149,20 @@ class Ecoset(datasets.GeneratorBasedBuilder):
149
  s3.download_file(urlinfo.netloc, urlinfo.path[1:], zip_path)
150
  # unzip
151
  # Expand-Archive -LiteralPath <PathToZipFile> -DestinationPath <PathToDestination>
152
- subprocess.call(["unzip", "-n", "-P", password.encode("ascii"), "-o", zip_path, "-d", target_dir], shell=False)
 
 
 
 
153
 
154
 
155
  # take slow or very slow download depending on platform
156
- if platform.system() in ("Linux", "Darwin"):
157
- archives = dl_manager.download_custom(_URLS["codeocean"], subprocess_download)
158
- else:
159
- archives = dl_manager.download_custom(_URLS["codeocean"], s3_zipfile_download)
 
 
160
 
161
  #archives = dl_manager.download(_URLS["codeocean"])
162
  print("Ecoset files are stored under: \n", archives)
 
149
  s3.download_file(urlinfo.netloc, urlinfo.path[1:], zip_path)
150
  # unzip
151
  # Expand-Archive -LiteralPath <PathToZipFile> -DestinationPath <PathToDestination>
152
+ if platform.system() in ("Linux", "Darwin"):
153
+ subprocess.call(["unzip", "-n", "-P", password.encode("ascii"), "-o", zip_path, "-d", target_dir], shell=False)
154
+ else:
155
+ subprocess.call(["tar.exe", "-xf", zip_path, "-C", target_dir, "--passphrase", password], shell=False)
156
+ # tar.exe -xf ecoset_uncompressed.zip -C uncompressed --passphrase ecoset_msjkk
157
 
158
 
159
  # take slow or very slow download depending on platform
160
+ archives = dl_manager.download_custom(_URLS["codeocean"], subprocess_download)
161
+ # take slow or very slow download depending on platform
162
+ #if platform.system() in ("Linux", "Darwin"):
163
+ # archives = dl_manager.download_custom(_URLS["codeocean"], subprocess_download)
164
+ #else:
165
+ # archives = dl_manager.download_custom(_URLS["codeocean"], s3_zipfile_download)
166
 
167
  #archives = dl_manager.download(_URLS["codeocean"])
168
  print("Ecoset files are stored under: \n", archives)