Repository 'data_manager_fetch_gene_annotation'
hg clone https://toolshed.g2.bx.psu.edu/repos/scottx611x/data_manager_fetch_gene_annotation

Changeset 15:6261b513ae1b (2016-06-22)
Previous changeset 14:4fb8bd379972 (2016-06-22) Next changeset 16:9002c2f64e2a (2016-06-22)
Commit message:
Uploaded
modified:
data_manager_gene_annotation/data_manager/data_manager.py
b
diff -r 4fb8bd379972 -r 6261b513ae1b data_manager_gene_annotation/data_manager/data_manager.py
--- 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
b
@@ -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: