This commit is contained in:
ZSerg 2016-08-22 09:10:45 +03:00
parent af36de091e
commit ad1cbefb15
7 changed files with 15 additions and 17 deletions

View File

@ -402,13 +402,13 @@ class ExifTool(object):
"an iterable of strings")
params = []
params_b = []
params_utf8 = []
for tag, value in tags.items():
params.append(u'-%s=%s' % (tag, value))
params.extend(filenames)
params_b = [x.encode('utf-8') for x in params]
return self.execute(*params_b)
params_utf8 = [x.encode('utf-8') for x in params]
return self.execute(*params_utf8)
def set_tags(self, tags, filename):
"""Writes the values of the specified tags for the given file.

View File

@ -2,15 +2,17 @@
from __future__ import print_function
from __future__ import division
from future import standard_library
standard_library.install_aliases()
from past.utils import old_div
from os import path
from configparser import ConfigParser
import fractions
standard_library.install_aliases() # noqa
import requests
import urllib.request, urllib.parse, urllib.error
import urllib.request
import urllib.parse
import urllib.error
from elodie import constants
from elodie.localstorage import Db
@ -77,7 +79,8 @@ def dms_to_decimal(degrees, minutes, seconds, direction=' '):
if(direction[0] in 'WSws'):
sign = -1
return (
float(degrees) + old_div(float(minutes), 60) + old_div(float(seconds), 3600)
float(degrees) + old_div(float(minutes), 60) +
old_div(float(seconds), 3600)
) * sign
@ -148,7 +151,7 @@ def reverse_lookup(lat, lon):
headers = {"Accept-Language": constants.accepted_language}
r = requests.get(
'http://open.mapquestapi.com/nominatim/v1/reverse.php?%s' %
urllib.parse.urlencode(params),headers=headers
urllib.parse.urlencode(params), headers=headers
)
return r.json()
except requests.exceptions.RequestException as e:

View File

@ -13,10 +13,11 @@ are used to represent the actual files.
import mimetypes
import os
try:
try: # Py3k compatibility
basestring
except NameError:
basestring = str
basestring = (bytes, str)
class Base(object):

View File

@ -9,7 +9,6 @@ are used to represent the actual files.
.. moduleauthor:: Jaisen Mathai <jaisen@jmathai.com>
"""
from __future__ import print_function
from builtins import object
# load modules
from elodie import constants

View File

@ -6,7 +6,6 @@ image objects (JPG, DNG, etc.).
"""
from __future__ import print_function
from __future__ import absolute_import
from builtins import str
import imghdr
import os

View File

@ -7,9 +7,6 @@ objects (AVI, MOV, etc.).
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from builtins import str
from builtins import object
from past.utils import old_div
# load modules
from distutils.spawn import find_executable

View File

@ -57,7 +57,6 @@ def test_get_date_taken():
audio = Audio(helper.get_file('audio.m4a'))
date_taken = audio.get_date_taken()
print('%r' % date_taken)
assert date_taken == (2016, 1, 4, 5, 24, 15, 0, 19, 0), date_taken
def test_get_exiftool_attributes():