def parameters_display(self, trans, **kwd): """ * GET /api/jobs/{job_id}/parameters_display * GET /api/datasets/{dataset_id}/parameters_display Resolve parameters as a list for nested display. More client logic here than is ideal but it is hard to reason about tool parameter types on the client relative to the server. Job accessibility checks are slightly different than dataset checks, so both methods are available. This API endpoint is unstable and tied heavily to Galaxy's JS client code, this endpoint will change frequently. :type job_id: string :param job_id: Encoded job id :type dataset_id: string :param dataset_id: Encoded HDA or LDDA id :type hda_ldda: string :param hda_ldda: hda if dataset_id is an HDA id (default), ldda if it is an ldda id. :rtype: list :returns: job parameters for for display """ job = self.__get_job(trans, **kwd) return summarize_job_parameters(trans, job)
def handle_job_parameters(self, line, job): markdown = """ | Input Parameter | Value | |-----------------|-------| """ parameters = summarize_job_parameters(self.trans, job)["parameters"] for parameter in parameters: markdown += "| " depth = parameter["depth"] if depth > 1: markdown += f"{'>' * (parameter['depth'] - 1)} " markdown += parameter["text"] markdown += " | " value = parameter["value"] if isinstance(value, list): markdown += ", ".join(f"{p['hid']}: {p['name']}" for p in value) else: markdown += value markdown += " |\n" return (markdown, True)
def handle_job_parameters(self, line, job): markdown = """ | Input Parameter | Value | |-----------------|-------| """ parameters = summarize_job_parameters(self.trans, job)["parameters"] for parameter in parameters: markdown += "| " depth = parameter["depth"] if depth > 1: markdown += ">" * (parameter["depth"] - 1) + " " markdown += parameter["text"] markdown += " | " value = parameter["value"] if isinstance(value, list): markdown += ", ".join("%s: %s" % (p["hid"], p["name"]) for p in value) else: markdown += value markdown += " |\n" return (markdown, True)