def gexiv2_version() -> str: """ :return: version number of GExiv2 """ # GExiv2.get_version() returns an integer XXYYZZ, where XX is the # major version, YY is the minor version, and ZZ is the micro version v = "{0:06d}".format(GExiv2.get_version()) return "{}.{}.{}".format(v[0:2], v[2:4], v[4:6]).replace("00", "0")
# # didjvu is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. '''XMP support (GExiv2 backend)''' import re import gi try: gi.require_version('GExiv2', '0.10') except ValueError as exc: # no coverage raise ImportError(exc) from gi.repository import GExiv2 if GExiv2.get_version() < 1003: raise ImportError('GExiv2 >= 0.10.3 is required') # no coverage from .. import temporary from .. import timestamp from . import namespaces as ns GExiv2.Metadata.register_xmp_namespace(ns.didjvu, 'didjvu') class XmpError(RuntimeError): pass class MetadataBase(object):
# didjvu is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. '''XMP support (GExiv2 backend)''' import re import gi try: gi.require_version('GExiv2', '0.10') except ValueError as exc: # no coverage raise ImportError(exc) from gi.repository import GExiv2 if GExiv2.get_version() < 1003: raise ImportError('GExiv2 >= 0.10.3 is required') # no coverage from .. import temporary from .. import timestamp from . import namespaces as ns GExiv2.Metadata.register_xmp_namespace(ns.didjvu, 'didjvu') class XmpError(RuntimeError): pass class MetadataBase(object): _empty_xmp = (