コード例 #1
0
def main(argv):
    args = arguments.parse(
        argv, None, ['file=', 'type='],
        './import.py --type=<photo or video> --file=<path to file>')

    if ('file' not in args):
        print 'No file specified'
        sys.exit(1)

    media = Media.get_class_by_file(args['file'], [Photo, Video])

    if (media is None):
        print 'Not a valid file'
        sys.exit(1)

    metadata = media.get_metadata()

    place_name = geolocation.place_name(metadata['latitude'],
                                        metadata['longitude'])

    output = {
        'latitude': metadata['latitude'],
        'longitude': metadata['longitude'],
        'place_name': place_name
    }
    print '%r' % output
コード例 #2
0
def main(argv):
    args = arguments.parse(argv, None, ['file='], './import.py --file=<path to file>')

    if('file' not in args):
        print 'No file specified'
        sys.exit(1)

    media = Media.get_class_by_file(args['file'], [Photo, Video])

    if(media is None):
        print 'Not a valid file'
        sys.exit(1)

    metadata = media.get_metadata()
    output = {'date_taken': metadata['date_taken']}
    print '%r' % output
コード例 #3
0
ファイル: geolocation.py プロジェクト: GonzaloAlvarez/elodie
def main(argv):
    args = arguments.parse(argv, None, ['file=','type='], './import.py --type=<photo or video> --file=<path to file>')

    if('file' not in args):
        print 'No file specified'
        sys.exit(1)

    media = Media.get_class_by_file(args['file'], [Photo, Video])

    if(media is None):
        print 'Not a valid file'
        sys.exit(1)

    metadata = media.get_metadata()

    place_name = geolocation.place_name(metadata['latitude'], metadata['longitude'])

    output = {'latitude': metadata['latitude'], 'longitude': metadata['longitude'], 'place_name': place_name}
    print '%r' % output