aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/pyexiv2/__init__.py4
-rw-r--r--src/pyexiv2/exif.py8
-rw-r--r--src/pyexiv2/utils.py4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/pyexiv2/__init__.py b/src/pyexiv2/__init__.py
index 517aa6f..4a4322f 100644
--- a/src/pyexiv2/__init__.py
+++ b/src/pyexiv2/__init__.py
@@ -63,8 +63,8 @@ from pyexiv2.metadata import ImageMetadata
from pyexiv2.exif import ExifValueError, ExifTag
from pyexiv2.iptc import IptcValueError, IptcTag
from pyexiv2.xmp import XmpValueError, XmpTag
-from pyexiv2.utils import FixedOffset, UndefinedToString, StringToUndefined, \
- Rational, NotifyingList
+from pyexiv2.utils import FixedOffset, Rational, NotifyingList, \
+ undefined_to_string, string_to_undefined
__version__ = (0, 2, 1)
diff --git a/src/pyexiv2/exif.py b/src/pyexiv2/exif.py
index 0afc39a..a543c1d 100644
--- a/src/pyexiv2/exif.py
+++ b/src/pyexiv2/exif.py
@@ -27,7 +27,7 @@
import libexiv2python
from pyexiv2.utils import Rational, NotifyingList, ListenerInterface, \
- UndefinedToString, StringToUndefined
+ undefined_to_string, string_to_undefined
import time
import datetime
@@ -273,7 +273,7 @@ class ExifTag(ListenerInterface):
# There is currently no charset conversion.
# TODO: guess the encoding and decode accordingly into unicode
# where relevant.
- return UndefinedToString(value)
+ return undefined_to_string(value)
raise ExifValueError(value, self.type)
@@ -359,11 +359,11 @@ class ExifTag(ListenerInterface):
elif self.type == 'Undefined':
if type(value) is unicode:
try:
- return StringToUndefined(value.encode('utf-8'))
+ return string_to_undefined(value.encode('utf-8'))
except UnicodeEncodeError:
raise ExifValueError(value, self.type)
elif type(value) is str:
- return StringToUndefined(value)
+ return string_to_undefined(value)
else:
raise ExifValueError(value, self.type)
diff --git a/src/pyexiv2/utils.py b/src/pyexiv2/utils.py
index 561e4f4..02fca1d 100644
--- a/src/pyexiv2/utils.py
+++ b/src/pyexiv2/utils.py
@@ -123,7 +123,7 @@ class FixedOffset(datetime.tzinfo):
(self.minutes == other.minutes)
-def UndefinedToString(undefined):
+def undefined_to_string(undefined):
"""
Convert an undefined string into its corresponding sequence of bytes.
The undefined string must contain the ascii codes of a sequence of bytes,
@@ -140,7 +140,7 @@ def UndefinedToString(undefined):
return ''.join(map(lambda x: chr(int(x)), undefined.rstrip().split(' ')))
-def StringToUndefined(sequence):
+def string_to_undefined(sequence):
"""
Convert a string into its undefined form.
The undefined form contains a sequence of ascii codes, each followed by a