diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2010-01-17 21:14:29 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2010-01-17 21:14:29 +0100 |
commit | 5bfa3b29709190f64238157448c456240d677ebd (patch) | |
tree | 144286fd99d98f59174f5e3738475c81a0c2cb7f /src | |
parent | 180abcdb87ba2f54c93e79b01a08fd039c95b256 (diff) | |
download | pyexiv2-5bfa3b29709190f64238157448c456240d677ebd.tar.gz |
Renamed UndefinedToString to undefined_to_string
and StringToUndefined to string_to_undefined, for consistency.
Diffstat (limited to 'src')
-rw-r--r-- | src/pyexiv2/__init__.py | 4 | ||||
-rw-r--r-- | src/pyexiv2/exif.py | 8 | ||||
-rw-r--r-- | src/pyexiv2/utils.py | 4 |
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 |