from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 5 _modified_time = 1287725781.101141 _template_filename='templates/tool_form.mako' _template_uri='tool_form.mako' _template_cache=cache.Cache(__name__, _modified_time) _source_encoding=None _exports = ['do_inputs', 'row_for_param'] def render_body(context,**pageargs): context.caller_stack._push_frame() try: __M_locals = __M_dict_builtin(pageargs=pageargs) add_frame = context.get('add_frame', UNDEFINED) errors = context.get('errors', UNDEFINED) h = context.get('h', UNDEFINED) tool = context.get('tool', UNDEFINED) def do_inputs(inputs,tool_state,errors,prefix,other_values=None): return render_do_inputs(context.locals_(__M_locals),inputs,tool_state,errors,prefix,other_values) len = context.get('len', UNDEFINED) util = context.get('util', UNDEFINED) unicode = context.get('unicode', UNDEFINED) type = context.get('type', UNDEFINED) tool_state = context.get('tool_state', UNDEFINED) trans = context.get('trans', UNDEFINED) AttributeError = context.get('AttributeError', UNDEFINED) app = context.get('app', UNDEFINED) __M_writer = context.writer() # SOURCE LINE 1 __M_writer(u'\n\n\n') # SOURCE LINE 4 from galaxy.util.expressions import ExpressionContext __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin()[__M_key]) for __M_key in ['ExpressionContext'] if __M_key in __M_locals_builtin()])) # SOURCE LINE 6 __M_writer(u'\n\n\n\n\nGalaxy\n\n') # SOURCE LINE 13 __M_writer(unicode(h.css( "base", "autocomplete_tagging" ))) __M_writer(u'\n') # SOURCE LINE 14 __M_writer(unicode(h.js( "jquery", "galaxy.base", "jquery.autocomplete" ))) __M_writer(u'\n\n\n\n\n ') # SOURCE LINE 128 __M_writer(u'\n \n ') # SOURCE LINE 169 __M_writer(u'\n \n') # SOURCE LINE 171 if add_frame.from_noframe: # SOURCE LINE 172 __M_writer(u'
\n Welcome to Galaxy\n
\n It appears that you found this tool from a link outside of Galaxy.\n If you\'re not familiar with Galaxy, please consider visiting the\n welcome page.\n To learn more about what Galaxy is and what it can do for you, please visit\n the Galaxy wiki.\n
\n
\n') # SOURCE LINE 183 __M_writer(u' \n') # SOURCE LINE 186 __M_writer(u' ') try: tool_url = h.url_for(tool.action) except AttributeError: assert len(tool.action) == 2 tool_url = tool.action[0] + h.url_for(tool.action[1]) __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin()[__M_key]) for __M_key in ['tool_url'] if __M_key in __M_locals_builtin()])) # SOURCE LINE 192 __M_writer(u'
\n') # SOURCE LINE 193 if tool.has_multiple_pages: # SOURCE LINE 194 __M_writer(u'
') __M_writer(unicode(tool.name)) __M_writer(u' (step ') __M_writer(unicode(tool_state.page+1)) __M_writer(u' of ') __M_writer(unicode(tool.npages)) __M_writer(u')
\n') # SOURCE LINE 195 else: # SOURCE LINE 196 __M_writer(u'
') __M_writer(unicode(tool.name)) __M_writer(u'
\n') # SOURCE LINE 198 __M_writer(u'
\n
\n \n \n') # SOURCE LINE 202 if tool.display_by_page[tool_state.page]: # SOURCE LINE 203 __M_writer(u' ') __M_writer(unicode(trans.fill_template_string( tool.display_by_page[tool_state.page], context=tool.get_param_html_map( trans, tool_state.page, tool_state.inputs ) ))) __M_writer(u'\n \n') # SOURCE LINE 205 else: # SOURCE LINE 206 __M_writer(u' ') __M_writer(unicode(do_inputs( tool.inputs_by_page[ tool_state.page ], tool_state.inputs, errors, "" ))) __M_writer(u'\n
\n') # SOURCE LINE 208 if tool_state.page == tool.last_page: # SOURCE LINE 209 __M_writer(u' \n') # SOURCE LINE 210 else: # SOURCE LINE 211 __M_writer(u' \n') # SOURCE LINE 213 __M_writer(u'
\n') # SOURCE LINE 215 __M_writer(u'
\n
\n
\n') # SOURCE LINE 218 if tool.help: # SOURCE LINE 219 __M_writer(u'
\n
\n ') # SOURCE LINE 221 if tool.has_multiple_pages: tool_help = tool.help_by_page[tool_state.page] else: tool_help = tool.help # Convert to unicode to display non-ascii characters. if type( tool_help ) is not unicode: tool_help = unicode( tool_help, 'utf-8') __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin()[__M_key]) for __M_key in ['tool_help'] if __M_key in __M_locals_builtin()])) # SOURCE LINE 230 __M_writer(u'\n ') # SOURCE LINE 231 __M_writer(unicode(tool_help)) __M_writer(u'\n
\n
\n') # SOURCE LINE 235 __M_writer(u'\n\n\n\n\n') return '' finally: context.caller_stack._pop_frame() def render_do_inputs(context,inputs,tool_state,errors,prefix,other_values=None): context.caller_stack._push_frame() try: def row_for_param(prefix,param,parent_state,parent_errors,other_values): return render_row_for_param(context,prefix,param,parent_state,parent_errors,other_values) h = context.get('h', UNDEFINED) def do_inputs(inputs,tool_state,errors,prefix,other_values=None): return render_do_inputs(context,inputs,tool_state,errors,prefix,other_values) len = context.get('len', UNDEFINED) range = context.get('range', UNDEFINED) dict = context.get('dict', UNDEFINED) str = context.get('str', UNDEFINED) enumerate = context.get('enumerate', UNDEFINED) trans = context.get('trans', UNDEFINED) ExpressionContext = context.get('ExpressionContext', UNDEFINED) __M_writer = context.writer() # SOURCE LINE 55 __M_writer(u'\n ') # SOURCE LINE 56 other_values = ExpressionContext( tool_state, other_values ) __M_writer(u'\n') # SOURCE LINE 57 for input_index, input in enumerate( inputs.itervalues() ): # SOURCE LINE 58 if input.type == "repeat": # SOURCE LINE 59 __M_writer(u'
\n
') # SOURCE LINE 60 __M_writer(unicode(input.title_plural)) __M_writer(u'
\n ') # SOURCE LINE 61 repeat_state = tool_state[input.name] __M_writer(u'\n') # SOURCE LINE 62 for i in range( len( repeat_state ) ): # SOURCE LINE 63 __M_writer(u'
\n ') # SOURCE LINE 64 if input.name in errors: rep_errors = errors[input.name][i] else: rep_errors = dict() index = repeat_state[i]['__index__'] # SOURCE LINE 70 __M_writer(u'\n
') # SOURCE LINE 71 __M_writer(unicode(input.title)) __M_writer(u' ') __M_writer(unicode(i + 1)) __M_writer(u'
\n ') # SOURCE LINE 72 __M_writer(unicode(do_inputs( input.inputs, repeat_state[i], rep_errors, prefix + input.name + "_" + str(index) + "|", other_values ))) __M_writer(u'\n
\n
\n') # SOURCE LINE 75 if rep_errors.has_key( '__index__' ): # SOURCE LINE 76 __M_writer(u'
 ') __M_writer(unicode(rep_errors['__index__'])) __M_writer(u'
\n') # SOURCE LINE 79 __M_writer(u'
\n
\n') # SOURCE LINE 81 elif input.type == "conditional": # SOURCE LINE 82 __M_writer(u' ') group_state = tool_state[input.name] group_errors = errors.get( input.name, {} ) current_case = group_state['__current_case__'] group_prefix = prefix + input.name + "|" # SOURCE LINE 87 __M_writer(u'\n') # SOURCE LINE 88 if input.value_ref_in_group: # SOURCE LINE 89 __M_writer(u' ') __M_writer(unicode(row_for_param( group_prefix, input.test_param, group_state, group_errors, other_values ))) __M_writer(u'\n') # SOURCE LINE 91 __M_writer(u' ') __M_writer(unicode(do_inputs( input.cases[current_case].inputs, group_state, group_errors, group_prefix, other_values ))) __M_writer(u'\n') # SOURCE LINE 92 elif input.type == "upload_dataset": # SOURCE LINE 93 if input.get_datatype( trans, other_values ).composite_type is None: #have non-composite upload appear as before # SOURCE LINE 94 __M_writer(u' ') if input.name in errors: rep_errors = errors[input.name][0] else: rep_errors = dict() # SOURCE LINE 99 __M_writer(u'\n ') # SOURCE LINE 100 __M_writer(unicode(do_inputs( input.inputs, tool_state[input.name][0], rep_errors, prefix + input.name + "_" + str( 0 ) + "|", other_values ))) __M_writer(u'\n') # SOURCE LINE 101 else: # SOURCE LINE 102 __M_writer(u'
\n
') # SOURCE LINE 103 __M_writer(unicode(input.group_title( other_values ))) __M_writer(u'
\n ') # SOURCE LINE 104 repeat_state = tool_state[input.name] # SOURCE LINE 106 __M_writer(u'\n') # SOURCE LINE 107 for i in range( len( repeat_state ) ): # SOURCE LINE 108 __M_writer(u'
\n ') # SOURCE LINE 109 if input.name in errors: rep_errors = errors[input.name][i] else: rep_errors = dict() index = repeat_state[i]['__index__'] # SOURCE LINE 115 __M_writer(u'\n
File Contents for ') # SOURCE LINE 116 __M_writer(unicode(input.title_by_index( trans, i, other_values ))) __M_writer(u'
\n ') # SOURCE LINE 117 __M_writer(unicode(do_inputs( input.inputs, repeat_state[i], rep_errors, prefix + input.name + "_" + str(index) + "|", other_values ))) __M_writer(u'\n') # SOURCE LINE 119 __M_writer(u'
\n') # SOURCE LINE 122 __M_writer(u'
\n') # SOURCE LINE 124 else: # SOURCE LINE 125 __M_writer(u' ') __M_writer(unicode(row_for_param( prefix, input, tool_state, errors, other_values ))) __M_writer(u'\n') # SOURCE LINE 128 __M_writer(u' ') return '' finally: context.caller_stack._pop_frame() def render_row_for_param(context,prefix,param,parent_state,parent_errors,other_values): context.caller_stack._push_frame() try: h = context.get('h', UNDEFINED) trans = context.get('trans', UNDEFINED) type = context.get('type', UNDEFINED) unicode = context.get('unicode', UNDEFINED) __M_writer = context.writer() # SOURCE LINE 130 __M_writer(u'\n ') # SOURCE LINE 131 if parent_errors.has_key( param.name ): cls = "form-row form-row-error" else: cls = "form-row" # SOURCE LINE 136 __M_writer(u'\n
\n ') # SOURCE LINE 138 label = param.get_label() __M_writer(u'\n') # SOURCE LINE 139 if label: # SOURCE LINE 140 __M_writer(u' \n') # SOURCE LINE 144 __M_writer(u' ') field = param.get_html_field( trans, parent_state[ param.name ], other_values ) field.refresh_on_change = param.refresh_on_change # Field may contain characters submitted by user and these characters may be unicode; handle non-ascii characters gracefully. field_html = field.get_html( prefix ) if type( field_html ) is not unicode: field_html = unicode( field_html, 'utf-8' ) # SOURCE LINE 152 __M_writer(u'\n
') # SOURCE LINE 153 __M_writer(unicode(field_html)) __M_writer(u'
\n') # SOURCE LINE 154 if parent_errors.has_key( param.name ): # SOURCE LINE 155 __M_writer(u'
\n
 ') __M_writer(unicode(parent_errors[param.name])) __M_writer(u'
\n
\n') # SOURCE LINE 159 __M_writer(u' \n') # SOURCE LINE 160 if param.help: # SOURCE LINE 161 __M_writer(u'
\n ') # SOURCE LINE 162 __M_writer(unicode(param.help)) __M_writer(u'\n
\n') # SOURCE LINE 165 __M_writer(u' \n
\n \n
\n ') return '' finally: context.caller_stack._pop_frame()