Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#####################################################################
# pyexiv2 download page (C) Olivier Tilloy
_DOWNLOAD_LINK = "http://tilloy.net/dev/pyexiv2/download.html"
# make sure the pyexiv2 library is installed and at least a minimum version
software_version = False
Min_VERSION = (0, 1, 3)
Min_VERSION_str = "pyexiv2-%d.%d.%d" % Min_VERSION
Pref_VERSION_str = "pyexiv2-%d.%d.%d" % (0, 3, 0)
# to be able for people that have pyexiv2-0.1.3 to be able to use this addon also...
LesserVersion = False
try:
import pyexiv2
software_version = pyexiv2.version_info
except ImportError, msg:
WarningDialog(_("You need to install, %s or greater, for this addon to work...\n"
"I would recommend installing, %s, and it may be downloaded from here: \n%s") % (
Min_VERSION_str, Pref_VERSION_str, _DOWNLOAD_LINK), str(msg))
raise Exception(_("Failed to load 'Image Metadata Gramplet'..."))
# This only happends if the user has pyexiv2-0.1.3 installed on their computer...
except AttributeError:
LesserVersion = True
# the library is either not installed or does not meet minimum required version for this addon....
if (software_version and (software_version < Min_VERSION)):
msg = _("The minimum required version for pyexiv2 must be %s \n"
"or greater. Or you do not have the python library installed yet. "
"You may download it from here: %s\n\n I recommend getting, %s") % (
# pyexiv2 download page (C) Olivier Tilloy
_DOWNLOAD_LINK = "http://tilloy.net/dev/pyexiv2/download.html"
# make sure the pyexiv2 library is installed and at least a minimum version
software_version = False
Min_VERSION = (0, 1, 3)
Min_VERSION_str = "pyexiv2-%d.%d.%d" % Min_VERSION
Pref_VERSION_str = "pyexiv2-%d.%d.%d" % (0, 3, 0)
# for users of pyexiv2 prior to 0.2.0...
LesserVersion = False
try:
import pyexiv2
software_version = pyexiv2.version_info
except ImportError, msg:
WarningDialog( str(msg) )
raise Exception(_("Failed to load 'Image Metadata Gramplet/ Addon'..."))
# This only happens if the user has prior than pyexiv2-0.2.0 installed on their computer...
# it requires the use of a few different things, which you will see when this variable is called...
except AttributeError:
LesserVersion = True
# the library is either not installed or does not meet
# minimum required version for this addon....
if (software_version and (software_version < Min_VERSION)):
msg = _("The minimum required version for pyexiv2 must be %s \n"
"or greater. Or you do not have the python library installed yet. "
"You may download it from here: %s\n\n I recommend getting, %s") % (
#------------------------------------------------
import gtk
from gen.ggettext import gettext as _
# import the pyexiv2 library classes for this addon
_DOWNLOAD_LINK = "http://tilloy.net/dev/pyexiv2/"
pyexiv2_required = True
Min_VERSION_str = "pyexiv2-%d.%d.%d" % (0, 1, 3)
LesserVersion = False
Min_VERSION = (0, 1, 3)
PrefVersion_str = "pyexiv2-%d.%d.%d" % (0, 3, 0)
try:
import pyexiv2
if pyexiv2.version_info < Min_VERSION:
pyexiv2_required = False
except ImportError:
raise Exception((_("The python binding library, pyexiv2, to exiv2 is not "
"installed on this computer.\n It can be downloaded from here: %s\n\n"
"You will need to download at least %s . I recommend that you download "
"and install, %s .") % ( _DOWNLOAD_LINK, Min_VERSION_str, PrefVersion_str)).encode(sys.getfilesystemencoding()) )
except AttributeError:
LesserVersion = True
if not pyexiv2_required:
raise Exception((_("The minimum required version for pyexiv2 must be %s \n"
"or greater. You may download it from here: %s\n\n I recommend getting, "
"%s .") % ( Min_VERSION_str, _DOWNLOAD_LINK, PrefVersion_str).encode(sys.getfilesystemencoding())) )
if repository.enumerate_versions("OsmGpsMap"):
from gi.repository import OsmGpsMap as osmgpsmap
try:
osmgpsmap_str = osmgpsmap._version
except :# any failure to 'get' the version
osmgpsmap_str = 'unknown version'
else:
osmgpsmap_str = 'not found'
except ImportError:
osmgpsmap_str = 'not found'
try:
import pyexiv2
try:
pyexiv2_str = '%d.%d.%d' % pyexiv2.version_info
except :# any failure to 'get' the version
pyexiv2_str = 'unknown version'
except ImportError:
pyexiv2_str = 'not found'
from gen.config import config
usebsddb3 = config.get('preferences.use-bsddb3')
try:
if usebsddb3:
import bsddb3 as bsddb
else:
import bsddb
bsddb_str = bsddb.__version__
bsddb_db_str = str(bsddb.db.version())
except: