Skip to content

Commit

Permalink
Remove unused select value helper
Browse files Browse the repository at this point in the history
  • Loading branch information
guerler committed Dec 1, 2017
1 parent 2966499 commit 3160743
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions lib/galaxy/web/form_builder.py
Expand Up @@ -108,34 +108,6 @@ def __init__(self, name, multiple=None, display=None, refresh_on_change=False, r
def add_option(self, text, value, selected=False):
self.options.append((text, value, selected))

def get_selected(self, return_label=False, return_value=False, multi=False):
'''
Return the currently selected option's label, value or both as a tuple. For
multi-select lists, a list is returned.
'''
if multi:
selected_options = []
for label, value, selected in self.options:
if selected:
if return_label and return_value:
if multi:
selected_options.append((label, value))
else:
return (label, value)
elif return_label:
if multi:
selected_options.append(label)
else:
return label
elif return_value:
if multi:
selected_options.append(value)
else:
return value
if multi:
return selected_options
return None

def to_dict(self):
d = super(SelectField, self).to_dict()
d['type'] = 'select'
Expand Down

0 comments on commit 3160743

Please sign in to comment.