From d134be8d2ea03965e7d4783e7a1fbf0557d534a2 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Thu, 13 May 2010 12:11:22 +0000 Subject: [PATCH] 3878: Private option and filter on Exporter svn: r15402 --- src/plugins/export/ExportGedcom.py | 32 +++++++++++++++--------------- src/plugins/export/ExportPkg.py | 14 ++++++------- src/plugins/export/ExportXml.py | 14 ++++++------- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/plugins/export/ExportGedcom.py b/src/plugins/export/ExportGedcom.py index e615dccce..95295a29e 100644 --- a/src/plugins/export/ExportGedcom.py +++ b/src/plugins/export/ExportGedcom.py @@ -254,22 +254,6 @@ class GedcomWriter(UpdateCallback): self.set_total(self.progress_cnt) self.progress_cnt = 0 - # If the private flag is set, apply the PrivateProxyDb - if option_box.private: - self.reset(_("Filtering private data")) - self.progress_cnt += 1 - self.update(self.progress_cnt) - self.dbase = gen.proxy.PrivateProxyDb(self.dbase) - - # If the restrict flag is set, apply the LivingProxyDb - if option_box.restrict: - self.reset(_("Filtering living persons")) - self.progress_cnt += 1 - self.update(self.progress_cnt) - self.dbase = gen.proxy.LivingProxyDb( - self.dbase, - gen.proxy.LivingProxyDb.MODE_INCLUDE_LAST_NAME_ONLY) - # If the filter returned by cfilter is not empty, apply the # FilterProxyDb (Person Filter) if not option_box.cfilter.is_empty(): @@ -287,6 +271,22 @@ class GedcomWriter(UpdateCallback): self.dbase = gen.proxy.FilterProxyDb( self.dbase, note_filter=option_box.nfilter) + # If the private flag is set, apply the PrivateProxyDb + if option_box.private: + self.reset(_("Filtering private data")) + self.progress_cnt += 1 + self.update(self.progress_cnt) + self.dbase = gen.proxy.PrivateProxyDb(self.dbase) + + # If the restrict flag is set, apply the LivingProxyDb + if option_box.restrict: + self.reset(_("Filtering living persons")) + self.progress_cnt += 1 + self.update(self.progress_cnt) + self.dbase = gen.proxy.LivingProxyDb( + self.dbase, + gen.proxy.LivingProxyDb.MODE_INCLUDE_LAST_NAME_ONLY) + # Apply the ReferencedProxyDb to remove any objects not referenced # after any of the other proxies have been applied if option_box.unlinked: diff --git a/src/plugins/export/ExportPkg.py b/src/plugins/export/ExportPkg.py index db1dca05c..b79ef58de 100644 --- a/src/plugins/export/ExportPkg.py +++ b/src/plugins/export/ExportPkg.py @@ -85,13 +85,6 @@ def writeData(database, filename, msg_callback, option_box=None, callback=None): if option_box: option_box.parse_options() - if option_box.private: - database = gen.proxy.PrivateProxyDb(database) - - if option_box.restrict: - database = gen.proxy.LivingProxyDb( - database, gen.proxy.LivingProxyDb.MODE_INCLUDE_LAST_NAME_ONLY) - # Apply the Person Filter if not option_box.cfilter.is_empty(): database = gen.proxy.FilterProxyDb(database, option_box.cfilter) @@ -101,6 +94,13 @@ def writeData(database, filename, msg_callback, option_box=None, callback=None): database = gen.proxy.FilterProxyDb( database, note_filter=option_box.nfilter) + if option_box.private: + database = gen.proxy.PrivateProxyDb(database) + + if option_box.restrict: + database = gen.proxy.LivingProxyDb( + database, gen.proxy.LivingProxyDb.MODE_INCLUDE_LAST_NAME_ONLY) + # Apply the ReferencedProxyDb to remove any objects not referenced # after any of the other proxies have been applied if option_box.unlinked: diff --git a/src/plugins/export/ExportXml.py b/src/plugins/export/ExportXml.py index 473a77939..9afbfd486 100644 --- a/src/plugins/export/ExportXml.py +++ b/src/plugins/export/ExportXml.py @@ -1164,13 +1164,6 @@ def export_data(database, filename, msg_callback, option_box=None, callback=None if option_box: option_box.parse_options() - if option_box.private: - database = gen.proxy.PrivateProxyDb(database) - - if option_box.restrict: - database = gen.proxy.LivingProxyDb( - database, gen.proxy.LivingProxyDb.MODE_INCLUDE_LAST_NAME_ONLY) - # Apply the Person Filter if not option_box.cfilter.is_empty(): database = gen.proxy.FilterProxyDb(database, option_box.cfilter) @@ -1180,6 +1173,13 @@ def export_data(database, filename, msg_callback, option_box=None, callback=None database = gen.proxy.FilterProxyDb( database, note_filter=option_box.nfilter) + if option_box.private: + database = gen.proxy.PrivateProxyDb(database) + + if option_box.restrict: + database = gen.proxy.LivingProxyDb( + database, gen.proxy.LivingProxyDb.MODE_INCLUDE_LAST_NAME_ONLY) + # Apply the ReferencedProxyDb to remove any objects not referenced # after any of the other proxies have been applied if option_box.unlinked: