Refactor sniff.stream_url_to_file to galaxy.files.uris.

The value of this can be seen for instance in unpack_tar_gz_archive - which should have nothing to do with datatypes and now doesn't need to load the whole datatypes module.

Use this in workflows API to allow downloading workflow files from configured URIs.
This commit is contained in:
John Chilton
2022-05-21 17:22:41 -04:00
parent ec2f121f0b
commit 37892dcabc
7 changed files with 62 additions and 31 deletions
+2 -1
View File
@@ -19,6 +19,7 @@ from galaxy.jobs import TOOL_PROVIDED_JOB_METADATA_FILE
from galaxy.util import (
DEFAULT_SOCKET_TIMEOUT,
get_charset_from_http_headers,
stream_to_open_named_file,
)
GALAXY_PARAM_PREFIX = "GALAXY"
@@ -107,7 +108,7 @@ def __main__():
% (file_size, max_file_size)
)
try:
cur_filename = sniff.stream_to_open_named_file(
cur_filename = stream_to_open_named_file(
page,
os.open(cur_filename, os.O_WRONLY | os.O_CREAT),
cur_filename,