From 4dc0f01137461ca709fcf37d30e4d12f3fc89cd9 Mon Sep 17 00:00:00 2001 From: Serge Noiraud Date: Wed, 13 Feb 2013 13:39:58 +0000 Subject: [PATCH] Geography : bug #6442 use the good glib with introspection. svn: r21348 --- gramps/plugins/lib/maps/geography.py | 10 +++++----- gramps/plugins/view/geomoves.py | 6 +++--- gramps/plugins/view/geoperson.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gramps/plugins/lib/maps/geography.py b/gramps/plugins/lib/maps/geography.py index a4fc40df8..348b0f37e 100644 --- a/gramps/plugins/lib/maps/geography.py +++ b/gramps/plugins/lib/maps/geography.py @@ -33,7 +33,7 @@ import sys import re from gi.repository import GObject import time -import glib +from gi.repository import GLib from math import pi #------------------------------------------------------------------------- @@ -599,10 +599,10 @@ class GeoGraphyView(OsmGps, NavigationView): and lvl < 18 ): lvl += 1 self.osm.set_zoom(lvl) - glib.timeout_add(50, self._autozoom_in, lvl, + GLib.timeout_add(int(50), self._autozoom_in, lvl, p1lat, p1lon, p2lat, p2lon) else: - glib.timeout_add(50, self._autozoom_out, lvl, + GLib.timeout_add(int(50), self._autozoom_out, lvl, p1lat, p1lon, p2lat, p2lon) def _autozoom_out(self, lvl, p1lat, p1lon, p2lat, p2lon): @@ -614,7 +614,7 @@ class GeoGraphyView(OsmGps, NavigationView): and lvl > 1 ): lvl -= 1 self.osm.set_zoom(lvl) - glib.timeout_add(50, self._autozoom_out, lvl, + GLib.timeout_add(int(50), self._autozoom_out, lvl, p1lat, p1lon, p2lat, p2lon) else: layer = self.get_selection_layer() @@ -641,7 +641,7 @@ class GeoGraphyView(OsmGps, NavigationView): p2lat = self.end_selection.rlat p2lon = self.end_selection.rlon # We zoom in until at least one marker missing. - glib.timeout_add(50, self._autozoom_in, level_start, + GLib.timeout_add(int(50), self._autozoom_in, level_start, p1lat, p1lon, p2lat, p2lon) def _set_center_and_zoom(self): diff --git a/gramps/plugins/view/geomoves.py b/gramps/plugins/view/geomoves.py index 96ecc1250..483fd01cd 100644 --- a/gramps/plugins/view/geomoves.py +++ b/gramps/plugins/view/geomoves.py @@ -38,7 +38,7 @@ from gi.repository import GObject import time import threading from math import * -import glib +from gi.repository import GLib #------------------------------------------------------------------------- # @@ -465,7 +465,7 @@ class GeoMoves(GeoGraphyView): return self.message_layer.add_message(_("All descendance for %s" % _nd.display(person))) color = Gdk.color_parse(self._config.get('geography.color_base')) - glib.timeout_add(int(self._config.get("geography.generation_interval")), + GLib.timeout_add(int(self._config.get("geography.generation_interval")), self.animate_moves, 0, person, color) def animate_moves(self, index, person, color): @@ -533,7 +533,7 @@ class GeoMoves(GeoGraphyView): time_to_wait = int(self._config.get("geography.generation_interval")) self._create_markers() # process next generation in a few milliseconds - glib.timeout_add(time_to_wait, self.animate_moves, + GLib.timeout_add(int(time_to_wait), self.animate_moves, index+1, person, color) else: self.started = False diff --git a/gramps/plugins/view/geoperson.py b/gramps/plugins/view/geoperson.py index fdc3cbd14..c0daf4fd4 100644 --- a/gramps/plugins/view/geoperson.py +++ b/gramps/plugins/view/geoperson.py @@ -40,7 +40,7 @@ KEY_TAB = Gdk.KEY_Tab import socket from gi.repository import Gtk from gi.repository import GObject -import glib +from gi.repository import GLib #------------------------------------------------------------------------- # @@ -276,7 +276,7 @@ class GeoPerson(GeoGraphyView): # in this case, stepyear is >= 9000 # large move means longitude or latitude differences greater than geography.maximum_lon_lat # degrees. - glib.timeout_add(self._config.get("geography.speed"), self.animate, + GLib.timeout_add(int(self._config.get("geography.speed")), self.animate, menu, marks, i, stepyear) return False