def layer_option(option, opt, value, parser):
 try:
  dest = int(value)
 except ValueError:
  dest = value
 setattr(parser.values, option.dest, dest)

def layer_option ( option , opt , value , parser ) : try : dest = int ( value ) except ValueError : dest = value setattr ( parser . values , option . dest , dest )
callback for make_option for the ogrinspect layer_key keyword option which may be an integer or a string .