def multi(method):
@functools.wraps(method)<EOL>def multi(self, address='<STR_LIT>'):<EOL><INDENT>values = flask.request.values<EOL>address = urllib.parse.unquote_plus(address)<EOL>if address and values and not address.endswith('<STR_LIT:.>'):<EOL><INDENT>address += '<STR_LIT:.>'<EOL><DEDENT>result = {}<EOL>for a in values or '<STR_LIT>':<EOL><INDENT>try:<EOL><INDENT>if not self.project:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>ed = editor.Editor(address + a, self.project)<EOL>result[address + a] = {'<STR_LIT:value>': method(self, ed, a)}<EOL><DEDENT>except:<EOL><INDENT>if self.project:<EOL><INDENT>traceback.print_exc()<EOL><DEDENT>result[address + a] = {'<STR_LIT:error>': '<STR_LIT>' % a}<EOL><DEDENT><DEDENT>return flask.jsonify(result)<EOL><DEDENT>return multi<EOL>
Decorator for RestServer methods that take multiple addresses