changeset 15:6261b513ae1b draft

Uploaded
author scottx611x
date Wed, 22 Jun 2016 16:25:38 -0400
parents 4fb8bd379972
children 9002c2f64e2a
files data_manager_gene_annotation/data_manager/data_manager.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/data_manager_gene_annotation/data_manager/data_manager.py	Wed Jun 22 16:25:21 2016 -0400
+++ b/data_manager_gene_annotation/data_manager/data_manager.py	Wed Jun 22 16:25:38 2016 -0400
@@ -30,11 +30,14 @@
 
 
 def url_download(url, name,  workdir):
+    # Create path if it doesn't exist
+    if not os.path.exists(workdir):
+        os.makedirs(workdir)
 
     response = requests.get(url=url, stream=True)
 
     # Create path that we will write the file to
-    file_path = 'download_{}.dat'.format(name)
+    file_path = os.path.join(workdir, 'download_{}.dat'.format(name))
 
     block_size = 10 * 1024 * 1024  # 10MB chunked download
     with open(file_path, 'w+') as f: