mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
fix composite images report
This commit is contained in:
@@ -46,10 +46,7 @@ export default {
|
||||
pathDestination.filepath
|
||||
);
|
||||
} else if (this.path === undefined || this.path === "undefined") {
|
||||
this.directoryContent = this.removeParentDirectory(
|
||||
pathDestination.datasetContent,
|
||||
pathDestination.datasetRootDir
|
||||
);
|
||||
this.directoryContent = pathDestination.datasetContent
|
||||
} else {
|
||||
this.errorMessage = `is not found!`;
|
||||
}
|
||||
|
||||
@@ -6,15 +6,11 @@ export const getPathDestination = async (history_dataset_id, path) => {
|
||||
const services = new Services({ root: getAppRoot() });
|
||||
|
||||
const computePathDestination = (pathDestination) => {
|
||||
if (pathDestination.datasetContent[0].class === "Directory")
|
||||
pathDestination.datasetRootDir = datasetContent[0].path;
|
||||
else return;
|
||||
|
||||
if (path === undefined || path === "undefined") {
|
||||
return pathDestination;
|
||||
}
|
||||
|
||||
const filepath = `${pathDestination.datasetRootDir}/${path}`;
|
||||
const filepath = path;
|
||||
|
||||
const datasetEntry = datasetContent.find((datasetEntry) => {
|
||||
return filepath === datasetEntry.path;
|
||||
|
||||
@@ -45,6 +45,7 @@ ARG_VAL_CAPTURED_REGEX = r'''(?:([\w_\-]+)|\"([^\"]+)\"|\'([^\']+)\')'''
|
||||
OUTPUT_LABEL_PATTERN = re.compile(r'output=\s*%s\s*' % ARG_VAL_CAPTURED_REGEX)
|
||||
INPUT_LABEL_PATTERN = re.compile(r'input=\s*%s\s*' % ARG_VAL_CAPTURED_REGEX)
|
||||
STEP_LABEL_PATTERN = re.compile(r'step=\s*%s\s*' % ARG_VAL_CAPTURED_REGEX)
|
||||
PATH_LABEL_PATTERN = re.compile(r'path=\s*%s\s*' % ARG_VAL_CAPTURED_REGEX)
|
||||
# STEP_OUTPUT_LABEL_PATTERN = re.compile(r'step_output=([\w_\-]+)/([\w_\-]+)')
|
||||
UNENCODED_ID_PATTERN = re.compile(r'(workflow_id|history_dataset_id|history_dataset_collection_id|job_id|invocation_id)=([\d]+)')
|
||||
ENCODED_ID_PATTERN = re.compile(r'(workflow_id|history_dataset_id|history_dataset_collection_id|job_id|invocation_id)=([a-z0-9]+)')
|
||||
@@ -378,7 +379,17 @@ class ToBasicMarkdownDirectiveHandler(GalaxyInternalMarkdownDirectiveHandler):
|
||||
def handle_dataset_as_image(self, line, hda):
|
||||
dataset = hda.dataset
|
||||
name = hda.name or ''
|
||||
with open(dataset.file_name, "rb") as f:
|
||||
|
||||
filepath = re.search(PATH_LABEL_PATTERN, line).group(2)
|
||||
|
||||
|
||||
if "path" in line:
|
||||
file = os.path.join(hda.extra_files_path, filepath)
|
||||
else:
|
||||
file = dataset.file_name
|
||||
|
||||
with open(file, "rb") as f:
|
||||
|
||||
base64_image_data = base64.b64encode(f.read()).decode("utf-8")
|
||||
rval = ("".format(name, base64_image_data), True)
|
||||
return rval
|
||||
|
||||
Reference in New Issue
Block a user