From f266ad2a99348a1d85c2f6420302593cf746e8fa Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sat, 7 May 2016 13:06:50 -0400 Subject: [PATCH] Remove accidentally added code --- gramps/gui/viewmanager.py | 26 -------------------------- gramps/plugins/database/dbapi.py | 24 ------------------------ 2 files changed, 50 deletions(-) diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index e0b54ff4c..d2fb5fbda 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -311,32 +311,6 @@ class ViewManager(CLIManager): # Need to call after plugins have been registered self.uistate.connect('update-available', self.process_updates) self.check_for_updates() - ## if sync flag: - self.start_update_remote_changes() - - def start_update_remote_changes(self): - """ - """ - global last_datetime - from gi.repository import GLib - from datetime import datetime, timezone - last_datetime = datetime.now(timezone.utc).astimezone() # local time, with timezone - - def update_remote_changes(): - """ - """ - global last_datetime - if self.dbstate.db.support_remote_changes() and self.dbstate.open: - updates = self.dbstate.db.get_updates_since(last_datetime) - last_datetime = datetime.now(timezone.utc).astimezone() # local time, with timezone - for update in updates: - signal, args = update - args = eval(args) # "person-delete", ([person.handle],) - GLib.idle_add(self.dbstate.db.emit, signal, args) - print("Emitting ", signal, args) - return True # True continues - - GLib.timeout_add_seconds(5, update_remote_changes) def check_for_updates(self): """ diff --git a/gramps/plugins/database/dbapi.py b/gramps/plugins/database/dbapi.py index a8e2c291a..d8ef2332d 100644 --- a/gramps/plugins/database/dbapi.py +++ b/gramps/plugins/database/dbapi.py @@ -132,7 +132,6 @@ class DBAPI(DbGeneric): self.dbapi = default_settings["dbapi"] self.update_schema() - self.start_update_changes() def update_schema(self): """ @@ -2014,26 +2013,3 @@ class DBAPI(DbGeneric): summary.update(self.dbapi.__class__.get_summary()) return summary - def start_update_changes(self): - """ - Listen to all changes, to emit them on remote databases. - """ - from functools import partial - signals = [] - for item in ["person", "family", "source", "citation", - "event", "media", "place", "repository", - "note", "tag"]: - signals.append('%s-update' % item) - signals.append('%s-delete' % item) - signals.append('%s-add' % item) - signals += ['person-rebuild', 'family-rebuild', 'place-rebuild', 'source-rebuild', - 'citation-rebuild', 'media-rebuild', 'event-rebuild', 'repository-rebuild', - 'note-rebuild', 'tag-rebuild', 'home-person-changed'] - for signal in signals: - self.connect(signal, lambda *args, signal=signal: self.record_update_change(signal, *args)) - - def record_update_change(self, signal, *args): - """ - Record the signal in the signal table. - """ - print(signal, args)