def screenshot():
 config_id = (request.args(0) or 1)
 size = get_vars.get('size')
 if (size == 'Letter'):
  height = 2550
  width = 3300
 elif (size == 'A4'):
  height = 2480
  width = 3508
 elif (size == 'A3'):
  height = 3508
  width = 4962
 elif (size == 'A2'):
  height = 4962
  width = 7017
 elif (size == 'A1'):
  height = 7017
  width = 9933
 elif (size == 'A0'):
  height = 9933
  width = 14061
 else:
  height = get_vars.get('height')
  try:
   height = int(height)
  except (ValueError, TypeError):
   height = 2480
  width = get_vars.get('width')
  try:
   width = int(width)
  except (ValueError, TypeError):
   width = 3508
 filename = gis.get_screenshot(config_id, height=height, width=width)
 if filename:
  redirect(URL(c='static', f='cache', args=['jpg', filename]))
 else:
  raise HTTP(500, 'Screenshot not taken')

def screenshot ( ) : config_id = ( request . args ( 0 ) or 1 ) size = get_vars . get ( 'size' ) if ( size == 'Letter' ) : height = 2550 width = 3300 elif ( size == 'A4' ) : height = 2480 width = 3508 elif ( size == 'A3' ) : height = 3508 width = 4962 elif ( size == 'A2' ) : height = 4962 width = 7017 elif ( size == 'A1' ) : height = 7017 width = 9933 elif ( size == 'A0' ) : height = 9933 width = 14061 else : height = get_vars . get ( 'height' ) try : height = int ( height ) except ( ValueError , TypeError ) : height = 2480 width = get_vars . get ( 'width' ) try : width = int ( width ) except ( ValueError , TypeError ) : width = 3508 filename = gis . get_screenshot ( config_id , height = height , width = width ) if filename : redirect ( URL ( c = 'static' , f = 'cache' , args = [ 'jpg' , filename ] ) ) else : raise HTTP ( 500 , 'Screenshot not taken' )
take a screenshot of a map .