Ejemplo n.º 1
0
def main():
    parser = argparse.ArgumentParser('Upload photos to Flickr')
    add_common_options(parser)

    args = parser.parse_args()
    logging.basicConfig(level=logging.DEBUG if args.debug else logging.INFO)

    init(args.api_key, args.api_secret)

    album = read_dat('album.dat')
    photo_data = read_dat('photos.dat')
    logging.debug('Will upload {0} photos to set: {1}'.format(len(photo_data),
                                                              album.title))
    photos = upload_photos(file_generator(photo_data))
    photoset = create_set(photos, title=album.title, description=album.description)
Ejemplo n.º 2
0
def main():
    parser = argparse.ArgumentParser('Upload photos to Flickr')
    add_common_options(parser)

    args = parser.parse_args()
    logging.basicConfig(level=logging.DEBUG if args.debug else logging.INFO)

    init(args.api_key, args.api_secret)

    album = read_dat('album.dat')
    photo_data = read_dat('photos.dat')
    logging.debug('Will upload {0} photos to set: {1}'.format(
        len(photo_data), album.title))
    photos = upload_photos(file_generator(photo_data))
    photoset = create_set(photos,
                          title=album.title,
                          description=album.description)
Ejemplo n.º 3
0
def main():
    parser = argparse.ArgumentParser('Upload photos to Flickr')
    add_common_options(parser)
    parser.add_argument('-f', '--description_file', type=str,
                        help='optional description file with photo titles')
    parser.add_argument('file', nargs='+',
                        help='file(s) to upload')

    args = parser.parse_args()
    logging.basicConfig(level=logging.DEBUG if args.debug else logging.INFO)

    init(args.api_key, args.api_secret)

    descr = None
    if args.description_file:
        descr = load_description_file(args.description_file)

    photos = upload_photos(file_generator(args.file, descr))

    set_name = descr.get('set_name')
    if set_name:
        create_set(photos, title=set_name)
Ejemplo n.º 4
0
def main():
    parser = argparse.ArgumentParser('Upload photos to Flickr')
    add_common_options(parser)
    parser.add_argument('-f',
                        '--description_file',
                        type=str,
                        help='optional description file with photo titles')
    parser.add_argument('file', nargs='+', help='file(s) to upload')

    args = parser.parse_args()
    logging.basicConfig(level=logging.DEBUG if args.debug else logging.INFO)

    init(args.api_key, args.api_secret)

    descr = None
    if args.description_file:
        descr = load_description_file(args.description_file)

    photos = upload_photos(file_generator(args.file, descr))

    set_name = descr.get('set_name')
    if set_name:
        create_set(photos, title=set_name)