Philipp Hörist pushed to branch master at gajim / gajim

Commits:
e5beff26 by Philipp Hörist at 2018-10-25T23:45:43Z
Guard GeoClue import

- So we dont have to check on module import if GeoClue is installed

- - - - -


1 changed file:

- gajim/common/dbus/location.py


Changes:

=====================================
gajim/common/dbus/location.py
=====================================
@@ -14,15 +14,13 @@
 # You should have received a copy of the GNU General Public License
 # along with Gajim. If not, see <http://www.gnu.org/licenses/>.
 
-from datetime import datetime
 import logging
+from datetime import datetime
+
+from gi.repository import GLib
 
 from gajim.common import app
 
-import gi
-gi.require_version('Geoclue', '2.0')
-from gi.repository import Geoclue
-from gi.repository import GLib
 
 log = logging.getLogger('gajim.c.dbus.location')
 
@@ -102,5 +100,10 @@ class LocationListener:
 
 
 def enable():
+    if not app.is_installed('GEOCLUE'):
+        log.warning('GeoClue not installed')
+        return
+
+    from gi.repository import Geoclue
     listener = LocationListener.get()
     listener.start()



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/e5beff266a2324542a5df3dcb76cb4f8654f8665

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/commit/e5beff266a2324542a5df3dcb76cb4f8654f8665
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to