'Returns dict of case value:inputs for metadata conditional for upload tool'

def get_upload_metadata_params(self, context, group, tool):

    rval = {}
    for (ext, d_type) in self.datatypes_by_extension.items():
        inputs = []
        for (meta_name, meta_spec) in d_type.metadata_spec.items():
            if meta_spec.set_in_upload:
                help_txt = meta_spec.desc
                if ((not help_txt) or (help_txt == meta_name)):
                    help_txt = ''
                inputs.append(('<param    type="text"    name="%s"    label="Set    metadata    value    for    &quot;%s&quot;"    value="%s"    help="%s"/>' % (meta_name, meta_name, meta_spec.default, help_txt)))
        rval[ext] = '\n'.join(inputs)
    if (('auto' not in rval) and ('txt' in rval)):
        rval['auto'] = rval['txt']
    return rval
