From 7dd02c35c00b1552697defeb96f0f108c1928f98 Mon Sep 17 00:00:00 2001 From: Christian Jacobs Date: Wed, 28 Mar 2018 21:12:14 +0100 Subject: [PATCH] Only define the NavigationToolbar derived class if the necessary modules are installed. --- pyqso/world_map.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pyqso/world_map.py b/pyqso/world_map.py index 7c88f88..8a3015b 100644 --- a/pyqso/world_map.py +++ b/pyqso/world_map.py @@ -48,11 +48,11 @@ except ImportError: logging.warning("Could not import the geocoder module!") have_geocoder = False - -class NavigationToolbar(NavigationToolbar2GTK3): - """ Navigation tools for the World Map. """ - # Only include a subset of the tools. - toolitems = [t for t in NavigationToolbar2GTK3.toolitems if t[0] in ("Home", "Zoom", "Save")] +if(have_necessary_modules): + class NavigationToolbar(NavigationToolbar2GTK3): + """ Navigation tools for the World Map. """ + # Only include a subset of the tools. + toolitems = [t for t in NavigationToolbar2GTK3.toolitems if t[0] in ("Home", "Zoom", "Save")] class Point: