|
22 | 22 | #
|
23 | 23 | # The full license is in the file LICENSE, distributed with this software.
|
24 | 24 | # -----------------------------------------------------------------------------
|
25 |
| -from os import stat, rename |
| 25 | +from os import stat |
| 26 | +from shutil import move |
26 | 27 | from os.path import join, relpath, basename
|
27 | 28 | from time import strftime, localtime
|
28 | 29 | import matplotlib.pyplot as plt
|
|
48 | 49 | "sName", "sVersion", "cID", "cName", "processing_job_id",
|
49 | 50 | "parameters", "samples", "columns", "input_size", "extra_info",
|
50 | 51 | "MaxRSSRaw", "ElapsedRaw", "Start", "node_name", "node_model"]
|
| 52 | +RAW_DATA_ARTIFACT_TYPE = { |
| 53 | + 'SFF', 'FASTQ', 'FASTA', 'FASTA_Sanger', 'per_sample_FASTQ'} |
51 | 54 |
|
52 | 55 |
|
53 | 56 | def _get_data_fpids(constructor, object_id):
|
@@ -118,9 +121,7 @@ def validate_filepath_access_by_user(user, filepath_id):
|
118 | 121 |
|
119 | 122 | if artifact.visibility == 'public':
|
120 | 123 | # TODO: https://github.com/biocore/qiita/issues/1724
|
121 |
| - if artifact.artifact_type in ['SFF', 'FASTQ', 'FASTA', |
122 |
| - 'FASTA_Sanger', |
123 |
| - 'per_sample_FASTQ']: |
| 124 | + if artifact.artifact_type in RAW_DATA_ARTIFACT_TYPE: |
124 | 125 | study = artifact.study
|
125 | 126 | has_access = study.has_access(user, no_public=True)
|
126 | 127 | if (not study.public_raw_download and not has_access):
|
@@ -469,7 +470,7 @@ def generate_biom_and_metadata_release(study_status='public'):
|
469 | 470 | for c in iter(lambda: f.read(4096), b""):
|
470 | 471 | md5sum.update(c)
|
471 | 472 |
|
472 |
| - rename(tgz_name, tgz_name_final) |
| 473 | + move(tgz_name, tgz_name_final) |
473 | 474 |
|
474 | 475 | vals = [
|
475 | 476 | ('filepath', tgz_name_final[len(working_dir):], r_client.set),
|
@@ -543,7 +544,7 @@ def generate_plugin_releases():
|
543 | 544 | md5sum = md5()
|
544 | 545 | for c in iter(lambda: f.read(4096), b""):
|
545 | 546 | md5sum.update(c)
|
546 |
| - rename(tgz_name, tgz_name_final) |
| 547 | + move(tgz_name, tgz_name_final) |
547 | 548 | vals = [
|
548 | 549 | ('filepath', tgz_name_final[len(working_dir):], r_client.set),
|
549 | 550 | ('md5sum', md5sum.hexdigest(), r_client.set),
|
|
0 commit comments