behave gracefully if no GExiv2 under Python3
svn: r21467
This commit is contained in:
parent
5e9837d484
commit
e6034cde4b
@ -240,11 +240,17 @@ def show_settings():
|
||||
osmgpsmap_str = 'not found'
|
||||
|
||||
try:
|
||||
from gi.repository import GExiv2
|
||||
try:
|
||||
gexiv2_str = GExiv2._version
|
||||
except: # any failure to 'get' the version
|
||||
gexiv2_str = 'unknown version'
|
||||
from gi import Repository
|
||||
repository = Repository.get_default()
|
||||
if repository.enumerate_versions("GExiv2"):
|
||||
from gi.repository import GExiv2
|
||||
try:
|
||||
gexiv2_str = GExiv2._version
|
||||
except: # any failure to 'get' the version
|
||||
gexiv2_str = 'unknown version'
|
||||
else:
|
||||
gexiv2_str = 'not found'
|
||||
|
||||
except ImportError:
|
||||
gexiv2_str = 'not found'
|
||||
|
||||
|
@ -371,12 +371,14 @@ register(GRAMPLET,
|
||||
)
|
||||
|
||||
try:
|
||||
from gi.repository import GExiv2
|
||||
available = True
|
||||
except:
|
||||
import logging
|
||||
logging.warning(_("WARNING: GExiv2 module not loaded. "
|
||||
"Image metadata functionality will not be available."))
|
||||
from gi import Repository
|
||||
repository = Repository.get_default()
|
||||
if repository.enumerate_versions("GExiv2"):
|
||||
from gi.repository import GExiv2
|
||||
available = True
|
||||
else:
|
||||
available = False
|
||||
except ImportError:
|
||||
available = False
|
||||
|
||||
if available:
|
||||
|
Loading…
Reference in New Issue
Block a user