예제 #1
0
def render_card():
  """Render a Card.

  GET Params:
    name - CardInfo name.
    taskid - CardInfo taskid.
    hours - CardInfo hours.
    risk - CardInfo risk.
    description - CardInfo description.

  Returns:
    Rendered PDF document.
  """
  info = card_info.from_dict(request.args)
  pdf = render.render_card_pdf(info)

  response = make_response(pdf)
  response.headers['Content-Type'] = 'application/pdf'
  return response
예제 #2
0
def print_card():
  """Print a Card.

  GET Params:
    name - CardInfo name.
    taskid - CardInfo taskid.
    hours - CardInfo hours.
    risk - CardInfo risk.
    description - CardInfo description.
    really - Will only actually print the Card if this is present and evaluates
        to True.
  """
  info = card_info.from_dict(request.args)
  pdf = render.render_card_pdf(info)

  really = bool(request.args.get('really', False))
  if really:
    print_queue.send_to_print_queue(pdf)
    return "Added to queue\n"

  else:
    return "Ok, but not queued (use 'really' param)\n"