Пример #1
0
                    '--user',
                    dest='user',
                    required=True,
                    help='username for Booking API')
    ap.add_argument('-p',
                    '--pass',
                    dest='password',
                    required=True,
                    help='password for Booking API')
    ap.add_argument('-c',
                    '--city',
                    dest='city',
                    required=True,
                    help='city for to look in (case insensitive)')
    ap.add_argument('--hotel',
                    dest='hotel',
                    help='hotel to look up (case insensitive)')
    ap.add_argument("-v",
                    "--verbose",
                    action="store_true",
                    help="more vebose output (debug)")

    args = ap.parse_args()
    if args.verbose:
        logging.basicConfig(level=logging.INFO)

    BC = BookingClient(args.user, args.password)

    hotel_info = BC.getHotelInfo(hotel=args.hotel, city=args.city, fuzzy=1)
    print json.dumps(hotel_info)