From ad55a28e083a0e7f3288c7e60412f1abf3c6b47f Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Mon, 13 Jul 2015 18:08:59 -0400 Subject: [PATCH] Dbstate: update docstring example on apply_proxy --- gramps/gen/dbstate.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/gramps/gen/dbstate.py b/gramps/gen/dbstate.py index 669ca4064..1dfd669db 100644 --- a/gramps/gen/dbstate.py +++ b/gramps/gen/dbstate.py @@ -115,8 +115,16 @@ class DbState(Callback): Add a proxy to the current database. Use pop_proxy() to revert to previous db. - >>> dbstate.apply_proxy(gen.proxy.LivingProxyDb, 1) - >>> dbstate.apply_proxy(gen.proxy.PrivateProxyDb) + >>> dbstate.apply_proxy(gramps.gen.proxy.LivingProxyDb, 0) + >>> dbstate.apply_proxy(gramps.gen.proxy.PrivateProxyDb) + + >>> from gramps.gen.filters.rules.person import IsDescendantOf, IsAncestorOf + >>> from gramps.gen.filters import GenericFilter + >>> filter = GenericFilter() + >>> filter.set_logical_op("or") + >>> filter.add_rule(IsDescendantOf([db.get_default_person().gramps_id, True])) + >>> filter.add_rule(IsAncestorOf([db.get_default_person().gramps_id, True])) + >>> dbstate.apply_proxy(gramps.gen.proxy.FilterProxyDb, filter) """ self.stack.append(self.db) self.db = proxy(self.db, *args, **kwargs)