예제 #1
0
def _get_dataset(dataset_id):
  if flask.request.method == 'PUT':
    return _update_dataset(dataset_id, flask.request)
  elif flask.request.method == 'POST':
    return _modify_dataset(dataset_id, flask.request)
  elif flask.request.method == 'DELETE':
    return _remove_dataset(dataset_id)
  d = get(dataset_id)
  if d is None:
    return 'invalid dataset id "'+str(dataset_id)+'"', 404
  r = flask.request.args.get('range', None)
  if r is not None:
    r = range.parse(r)
  return caleydo_server.util.jsonify(d.asjson(r))
예제 #2
0
def asrange(r = None):
  if r is None:
    return None
  import caleydo_server.range as ranges
  return ranges.parse(r)