Skip to content

Commit

Permalink
Verify existing of runtime environment for textable mode
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed May 31, 2018
1 parent 27106c5 commit 5d15561
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/galaxy/tools/parameters/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,11 @@ def _get_dynamic_options_call_other_values(self, trans, other_values):
call_other_values.update(other_values.dict)
return call_other_values

def _is_runtime_context(self, trans, other_values):
for context_value in other_values.values():
if is_runtime_value(context_value) or has_runtime_datasets(trans, context_value):
return True

def get_options(self, trans, other_values):
if self.options:
return self.options.get_options(trans, other_values)
Expand Down Expand Up @@ -854,11 +859,7 @@ def get_legal_values(self, trans, other_values):

def from_json(self, value, trans, other_values={}):
legal_values = self.get_legal_values(trans, other_values)
workflow_building_mode = trans.workflow_building_mode
for context_value in other_values.values():
if is_runtime_value(context_value) or has_runtime_datasets(trans, context_value):
workflow_building_mode = workflow_building_modes.ENABLED
break
workflow_building_mode = trans.workflow_building_mode or self._is_runtime_context(trans, other_values)
if not legal_values and workflow_building_mode:
if self.multiple:
# While it is generally allowed that a select value can be '',
Expand Down Expand Up @@ -972,7 +973,7 @@ def to_dict(self, trans, other_values={}):
d['options'] = options
d['display'] = self.display
d['multiple'] = self.multiple
d['textable'] = True
d['textable'] = self._is_runtime_context(trans, other_values)
return d


Expand Down

0 comments on commit 5d15561

Please sign in to comment.