2015-10-14 05:26:55 +02:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
import os
|
|
|
|
import shutil
|
|
|
|
import sys
|
|
|
|
|
|
|
|
from elodie import arguments
|
2015-10-20 10:17:09 +02:00
|
|
|
from elodie.media.photo import Media
|
2015-10-14 05:26:55 +02:00
|
|
|
from elodie.media.photo import Photo
|
|
|
|
from elodie.media.video import Video
|
|
|
|
|
|
|
|
def main(argv):
|
2015-10-20 10:17:09 +02:00
|
|
|
args = arguments.parse(argv, None, ['file='], './import.py --file=<path to file>')
|
2015-10-14 05:26:55 +02:00
|
|
|
|
|
|
|
if('file' not in args):
|
|
|
|
print 'No file specified'
|
|
|
|
sys.exit(1)
|
|
|
|
|
2015-10-20 10:17:09 +02:00
|
|
|
media = Media.get_class_by_file(args['file'], [Photo, Video])
|
2015-10-14 05:26:55 +02:00
|
|
|
|
2015-10-20 10:17:09 +02:00
|
|
|
if(media is None):
|
|
|
|
print 'Not a valid file'
|
|
|
|
sys.exit(1)
|
2015-10-15 06:27:42 +02:00
|
|
|
|
2015-10-20 10:17:09 +02:00
|
|
|
metadata = media.get_metadata()
|
2015-10-14 05:26:55 +02:00
|
|
|
output = {'date_taken': metadata['date_taken']}
|
|
|
|
print '%r' % output
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main(sys.argv[1:])
|
|
|
|
sys.exit(0)
|