Improve gen.proxy documentation

This commit is contained in:
Nick Hall 2013-11-12 18:03:20 +00:00
parent 1bd893f9f0
commit f80e6422a3
5 changed files with 236 additions and 232 deletions

View File

@ -24,7 +24,7 @@
# $Id$
"""
Proxy class for the GRAMPS databases. Apply filter
Proxy class for the Gramps databases. Apply filter
"""
#-------------------------------------------------------------------------
@ -85,7 +85,7 @@ class FilterProxyDb(ProxyDbBase):
def get_person_from_handle(self, handle):
"""
Finds a Person in the database from the passed gramps' ID.
Finds a Person in the database from the passed Gramps ID.
If no such Person exists, None is returned.
"""
if handle in self.plist:
@ -138,7 +138,7 @@ class FilterProxyDb(ProxyDbBase):
def get_source_from_handle(self, handle):
"""
Finds a Source in the database from the passed gramps' ID.
Finds a Source in the database from the passed Gramps ID.
If no such Source exists, None is returned.
"""
source = self.db.get_source_from_handle(handle)
@ -162,7 +162,7 @@ class FilterProxyDb(ProxyDbBase):
def get_citation_from_handle(self, handle):
"""
Finds a Citation in the database from the passed gramps' ID.
Finds a Citation in the database from the passed Gramps ID.
If no such Citation exists, None is returned.
"""
citation = self.db.get_citation_from_handle(handle)
@ -172,7 +172,7 @@ class FilterProxyDb(ProxyDbBase):
def get_object_from_handle(self, handle):
"""
Finds a MediaObject in the database from the passed GRAMPS' handle.
Finds a MediaObject in the database from the passed Gramps handle.
If no such Object exists, None is returned.
"""
media = self.db.get_object_from_handle(handle)
@ -189,7 +189,7 @@ class FilterProxyDb(ProxyDbBase):
def get_place_from_handle(self, handle):
"""
Finds a Place in the database from the passed GRAMPS' handle.
Finds a Place in the database from the passed Gramps handle.
If no such Place exists, None is returned.
"""
place = self.db.get_place_from_handle(handle)
@ -209,7 +209,7 @@ class FilterProxyDb(ProxyDbBase):
def get_event_from_handle(self, handle):
"""
Finds a Event in the database from the passed gramps' ID.
Finds a Event in the database from the passed Gramps ID.
If no such Event exists, None is returned.
"""
if handle in self.elist:
@ -222,7 +222,7 @@ class FilterProxyDb(ProxyDbBase):
def get_family_from_handle(self, handle):
"""
Finds a Family in the database from the passed gramps' ID.
Finds a Family in the database from the passed Gramps ID.
If no such Family exists, None is returned.
"""
if handle in self.flist:
@ -277,7 +277,7 @@ class FilterProxyDb(ProxyDbBase):
def get_repository_from_handle(self, handle):
"""
Finds a Repository in the database from the passed gramps' ID.
Finds a Repository in the database from the passed Gramps ID.
If no such Repository exists, None is returned.
"""
repository = self.db.get_repository_from_handle(handle)
@ -288,7 +288,7 @@ class FilterProxyDb(ProxyDbBase):
def get_note_from_handle(self, handle):
"""
Finds a Note in the database from the passed gramps' ID.
Finds a Note in the database from the passed Gramps ID.
If no such Note exists, None is returned.
"""
if handle in self.nlist:
@ -298,7 +298,7 @@ class FilterProxyDb(ProxyDbBase):
def get_person_from_gramps_id(self, val):
"""
Finds a Person in the database from the passed GRAMPS ID.
Finds a Person in the database from the passed Gramps ID.
If no such Person exists, None is returned.
"""
person = self.db.get_person_from_gramps_id(val)
@ -309,7 +309,7 @@ class FilterProxyDb(ProxyDbBase):
def get_family_from_gramps_id(self, val):
"""
Finds a Family in the database from the passed GRAMPS ID.
Finds a Family in the database from the passed Gramps ID.
If no such Family exists, None is returned.
"""
family = self.db.get_family_from_gramps_id(val)
@ -320,7 +320,7 @@ class FilterProxyDb(ProxyDbBase):
def get_event_from_gramps_id(self, val):
"""
Finds an Event in the database from the passed GRAMPS ID.
Finds an Event in the database from the passed Gramps ID.
If no such Event exists, None is returned.
"""
event = self.db.get_event_from_gramps_id(val)
@ -331,7 +331,7 @@ class FilterProxyDb(ProxyDbBase):
def get_place_from_gramps_id(self, val):
"""
Finds a Place in the database from the passed gramps' ID.
Finds a Place in the database from the passed Gramps ID.
If no such Place exists, None is returned.
"""
place = self.db.get_place_from_gramps_id(val)
@ -342,7 +342,7 @@ class FilterProxyDb(ProxyDbBase):
def get_source_from_gramps_id(self, val):
"""
Finds a Source in the database from the passed gramps' ID.
Finds a Source in the database from the passed Gramps ID.
If no such Source exists, None is returned.
"""
source = self.db.get_source_from_gramps_id(val)
@ -353,7 +353,7 @@ class FilterProxyDb(ProxyDbBase):
def get_citation_from_gramps_id(self, val):
"""
Finds a Citation in the database from the passed gramps' ID.
Finds a Citation in the database from the passed Gramps ID.
If no such Citation exists, None is returned.
"""
citation = self.db.get_citation_from_gramps_id(val)
@ -364,7 +364,7 @@ class FilterProxyDb(ProxyDbBase):
def get_object_from_gramps_id(self, val):
"""
Finds a MediaObject in the database from the passed gramps' ID.
Finds a MediaObject in the database from the passed Gramps ID.
If no such MediaObject exists, None is returned.
"""
media = self.db.get_object_from_gramps_id(val)
@ -375,7 +375,7 @@ class FilterProxyDb(ProxyDbBase):
def get_repository_from_gramps_id(self, val):
"""
Finds a Repository in the database from the passed gramps' ID.
Finds a Repository in the database from the passed Gramps ID.
If no such Repository exists, None is returned.
"""
repository = self.db.get_repository_from_gramps_id(val)
@ -386,7 +386,7 @@ class FilterProxyDb(ProxyDbBase):
def get_note_from_gramps_id(self, val):
"""
Finds a Note in the database from the passed gramps' ID.
Finds a Note in the database from the passed Gramps ID.
If no such Note exists, None is returned.
"""
note = self.db.get_note_from_gramps_id(val)
@ -521,11 +521,11 @@ class FilterProxyDb(ProxyDbBase):
Find all objects that hold a reference to the object handle.
Returns an iterator over a list of (class_name, handle) tuples.
@param handle: handle of the object to search for.
@type handle: database handle
@param include_classes: list of class names to include in the results.
:param handle: handle of the object to search for.
:type handle: database handle
:param include_classes: list of class names to include in the results.
Default: None means include all classes.
@type include_classes: list of class names
:type include_classes: list of class names
This default implementation does a sequential scan through all
the primary object databases and is very slow. Backends can
@ -533,7 +533,7 @@ class FilterProxyDb(ProxyDbBase):
make use of additional capabilities of the backend.
Note that this is a generator function, it returns a iterator for
use in loops. If you want a list of the results use:
use in loops. If you want a list of the results use::
> result_list = list(find_backlink_handles(handle))
"""
@ -543,8 +543,9 @@ class FilterProxyDb(ProxyDbBase):
def sanitize_notebase(self, notebase):
"""
Filters notes out of the passed notebase object according to the Note Filter.
@param notebase: NoteBase object to clean
@type event: NoteBase
:param notebase: NoteBase object to clean
:type event: NoteBase
"""
if notebase:
note_list = notebase.get_note_list()
@ -560,8 +561,9 @@ class FilterProxyDb(ProxyDbBase):
def sanitize_person(self, person):
"""
Cleans filtered notes out of the passed person
@param event: Person object to clean
@type event: Person
:param event: Person object to clean
:type event: Person
"""
if person:
# Filter note references

View File

@ -21,7 +21,7 @@
# $Id$
"""
Proxy class for the GRAMPS databases. Filter out all living people.
Proxy class for the Gramps databases. Filter out all living people.
"""
#-------------------------------------------------------------------------
@ -63,22 +63,23 @@ class LivingProxyDb(ProxyDbBase):
"""
Create a new LivingProxyDb instance.
@param dbase: The database to be a proxy for
@type dbase: DbBase
@param mode: The method for handling living people.
LivingProxyDb.MODE_EXCLUDE_ALL will remove living people altogether.
LivingProxyDb.MODE_INCLUDE_LAST_NAME_ONLY will remove all information
and change their given name to "[Living]" or what has been set in
Preferences -> Text.
LivingProxyDb.MODE_INCLUDE_FULL_NAME_ONLY will remove all information
but leave the entire name intact.
@type mode: int
@param current_year: The current year to use for living determination.
:param dbase: The database to be a proxy for
:type dbase: DbBase
:param mode:
The method for handling living people.
LivingProxyDb.MODE_EXCLUDE_ALL will remove living people altogether.
LivingProxyDb.MODE_INCLUDE_LAST_NAME_ONLY will remove all
information and change their given name to "[Living]" or what has
been set in Preferences -> Text.
LivingProxyDb.MODE_INCLUDE_FULL_NAME_ONLY will remove all
information but leave the entire name intact.
:type mode: int
:param current_year: The current year to use for living determination.
If None is supplied, the current year will be found from the system.
@type current_year: int or None
@param years_after_death: The number of years after a person's death to
still consider them living.
@type years_after_death: int
:type current_year: int or None
:param years_after_death: The number of years after a person's death to
still consider them living.
:type years_after_death: int
"""
ProxyDbBase.__init__(self, dbase)
self.mode = mode
@ -91,7 +92,7 @@ class LivingProxyDb(ProxyDbBase):
def get_person_from_handle(self, handle):
"""
Finds a Person in the database from the passed gramps ID.
Finds a Person in the database from the passed Gramps ID.
If no such Person exists, None is returned.
"""
person = self.db.get_person_from_handle(handle)
@ -126,7 +127,7 @@ class LivingProxyDb(ProxyDbBase):
def get_person_from_gramps_id(self, val):
"""
Finds a Person in the database from the passed GRAMPS ID.
Finds a Person in the database from the passed Gramps ID.
If no such Person exists, None is returned.
"""
person = self.db.get_person_from_gramps_id(val)
@ -140,7 +141,7 @@ class LivingProxyDb(ProxyDbBase):
def get_family_from_gramps_id(self, val):
"""
Finds a Family in the database from the passed GRAMPS ID.
Finds a Family in the database from the passed Gramps ID.
If no such Family exists, None is returned.
"""
family = self.db.get_family_from_gramps_id(val)
@ -179,11 +180,11 @@ class LivingProxyDb(ProxyDbBase):
Find all objects that hold a reference to the object handle.
Returns an iterator over a list of (class_name, handle) tuples.
@param handle: handle of the object to search for.
@type handle: database handle
@param include_classes: list of class names to include in the results.
:param handle: handle of the object to search for.
:type handle: database handle
:param include_classes: list of class names to include in the results.
Default: None means include all classes.
@type include_classes: list of class names
:type include_classes: list of class names
This default implementation does a sequential scan through all
the primary object databases and is very slow. Backends can
@ -191,7 +192,7 @@ class LivingProxyDb(ProxyDbBase):
make use of additional capabilities of the backend.
Note that this is a generator function, it returns a iterator for
use in loops. If you want a list of the results use:
use in loops. If you want a list of the results use::
> result_list = list(find_backlink_handles(handle))
"""

View File

@ -23,7 +23,7 @@
# $Id$
"""
Proxy class for the GRAMPS databases. Filter out all data marked private.
Proxy class for the Gramps databases. Filter out all data marked private.
"""
#-------------------------------------------------------------------------
@ -61,7 +61,7 @@ class PrivateProxyDb(ProxyDbBase):
def get_person_from_handle(self, handle):
"""
Finds a Person in the database from the passed gramps' ID.
Finds a Person in the database from the passed Gramps ID.
If no such Person exists, None is returned.
"""
person = self.db.get_person_from_handle(handle)
@ -71,7 +71,7 @@ class PrivateProxyDb(ProxyDbBase):
def get_source_from_handle(self, handle):
"""
Finds a Source in the database from the passed gramps' ID.
Finds a Source in the database from the passed Gramps ID.
If no such Source exists, None is returned.
"""
source = self.db.get_source_from_handle(handle)
@ -81,7 +81,7 @@ class PrivateProxyDb(ProxyDbBase):
def get_citation_from_handle(self, handle):
"""
Finds a Citation in the database from the passed gramps' ID.
Finds a Citation in the database from the passed Gramps ID.
If no such Citation exists, None is returned.
"""
citation = self.db.get_citation_from_handle(handle)
@ -91,7 +91,7 @@ class PrivateProxyDb(ProxyDbBase):
def get_object_from_handle(self, handle):
"""
Finds an Object in the database from the passed gramps' ID.
Finds an Object in the database from the passed Gramps ID.
If no such Object exists, None is returned.
"""
media = self.db.get_object_from_handle(handle)
@ -101,7 +101,7 @@ class PrivateProxyDb(ProxyDbBase):
def get_place_from_handle(self, handle):
"""
Finds a Place in the database from the passed gramps' ID.
Finds a Place in the database from the passed Gramps ID.
If no such Place exists, None is returned.
"""
place = self.db.get_place_from_handle(handle)
@ -111,7 +111,7 @@ class PrivateProxyDb(ProxyDbBase):
def get_event_from_handle(self, handle):
"""
Finds a Event in the database from the passed gramps' ID.
Finds a Event in the database from the passed Gramps ID.
If no such Event exists, None is returned.
"""
event = self.db.get_event_from_handle(handle)
@ -121,7 +121,7 @@ class PrivateProxyDb(ProxyDbBase):
def get_family_from_handle(self, handle):
"""
Finds a Family in the database from the passed gramps' ID.
Finds a Family in the database from the passed Gramps ID.
If no such Family exists, None is returned.
"""
family = self.db.get_family_from_handle(handle)
@ -131,7 +131,7 @@ class PrivateProxyDb(ProxyDbBase):
def get_repository_from_handle(self, handle):
"""
Finds a Repository in the database from the passed gramps' ID.
Finds a Repository in the database from the passed Gramps ID.
If no such Repository exists, None is returned.
"""
repository = self.db.get_repository_from_handle(handle)
@ -141,7 +141,7 @@ class PrivateProxyDb(ProxyDbBase):
def get_note_from_handle(self, handle):
"""
Finds a Note in the database from the passed gramps' ID.
Finds a Note in the database from the passed Gramps ID.
If no such Note exists, None is returned.
"""
note = self.db.get_note_from_handle(handle)
@ -181,7 +181,7 @@ class PrivateProxyDb(ProxyDbBase):
def get_place_from_gramps_id(self, val):
"""
Finds a Place in the database from the passed gramps' ID.
Finds a Place in the database from the passed Gramps ID.
If no such Place exists, None is returned.
"""
place = self.db.get_place_from_gramps_id(val)
@ -191,7 +191,7 @@ class PrivateProxyDb(ProxyDbBase):
def get_source_from_gramps_id(self, val):
"""
Finds a Source in the database from the passed gramps' ID.
Finds a Source in the database from the passed Gramps ID.
If no such Source exists, None is returned.
"""
source = self.db.get_source_from_gramps_id(val)
@ -201,7 +201,7 @@ class PrivateProxyDb(ProxyDbBase):
def get_citation_from_gramps_id(self, val):
"""
Finds a Citation in the database from the passed gramps' ID.
Finds a Citation in the database from the passed Gramps ID.
If no such Citation exists, None is returned.
"""
citation = self.db.get_citation_from_gramps_id(val)
@ -211,7 +211,7 @@ class PrivateProxyDb(ProxyDbBase):
def get_object_from_gramps_id(self, val):
"""
Finds a MediaObject in the database from the passed gramps' ID.
Finds a MediaObject in the database from the passed Gramps ID.
If no such MediaObject exists, None is returned.
"""
obj = self.db.get_object_from_gramps_id(val)
@ -221,7 +221,7 @@ class PrivateProxyDb(ProxyDbBase):
def get_repository_from_gramps_id(self, val):
"""
Finds a Repository in the database from the passed gramps' ID.
Finds a Repository in the database from the passed Gramps ID.
If no such Repository exists, None is returned.
"""
repository = self.db.get_repository_from_gramps_id(val)
@ -231,7 +231,7 @@ class PrivateProxyDb(ProxyDbBase):
def get_note_from_gramps_id(self, val):
"""
Finds a Note in the database from the passed gramps' ID.
Finds a Note in the database from the passed Gramps ID.
If no such Note exists, None is returned.
"""
note = self.db.get_note_from_gramps_id(val)
@ -405,11 +405,11 @@ class PrivateProxyDb(ProxyDbBase):
Find all objects that hold a reference to the object handle.
Returns an iterator over a list of (class_name, handle) tuples.
@param handle: handle of the object to search for.
@type handle: database handle
@param include_classes: list of class names to include in the results.
:param handle: handle of the object to search for.
:type handle: database handle
:param include_classes: list of class names to include in the results.
Default: None means include all classes.
@type include_classes: list of class names
:type include_classes: list of class names
This default implementation does a sequential scan through all
the primary object databases and is very slow. Backends can
@ -417,7 +417,7 @@ class PrivateProxyDb(ProxyDbBase):
make use of additional capabilities of the backend.
Note that this is a generator function, it returns a iterator for
use in loops. If you want a list of the results use:
use in loops. If you want a list of the results use::
> result_list = list(find_backlink_handles(handle))
"""
@ -453,13 +453,13 @@ def copy_media_ref_list(db, original_obj, clean_obj):
Copies media references from one object to another - excluding private
references and references to private objects.
@param db: GRAMPS database to which the references belongs
@type db: DbBase
@param original_obj: Object that may have private references
@type original_obj: MediaBase
@param clean_obj: Object that will have only non-private references
@type original_obj: MediaBase
@returns: Nothing
:param db: Gramps database to which the references belongs
:type db: DbBase
:param original_obj: Object that may have private references
:type original_obj: MediaBase
:param clean_obj: Object that will have only non-private references
:type original_obj: MediaBase
:returns: Nothing
"""
for media_ref in original_obj.get_media_list():
if media_ref and not media_ref.get_privacy():
@ -474,13 +474,13 @@ def copy_citation_ref_list(db, original_obj, clean_obj):
to private citations, and references to citations that refer to private
sources.
@param db: GRAMPS database to which the references belongs
@type db: DbBase
@param original_obj: Object that may have private references
@type original_obj: CitationBase
@param clean_obj: Object that will have only non-private references
@type original_obj: CitationBase
@returns: Nothing
:param db: Gramps database to which the references belongs
:type db: DbBase
:param original_obj: Object that may have private references
:type original_obj: CitationBase
:param clean_obj: Object that will have only non-private references
:type original_obj: CitationBase
:returns: Nothing
"""
for citation_handle in original_obj.get_citation_list():
citation = db.get_citation_from_handle(citation_handle)
@ -495,13 +495,13 @@ def copy_notes(db, original_obj, clean_obj):
Copies notes from one object to another - excluding references to private
notes.
@param db: GRAMPS database to which the references belongs
@type db: DbBase
@param original_obj: Object that may have private references
@type original_obj: NoteBase
@param clean_obj: Object that will have only non-private references
@type original_obj: NoteBase
@returns: Nothing
:param db: Gramps database to which the references belongs
:type db: DbBase
:param original_obj: Object that may have private references
:type original_obj: NoteBase
:param clean_obj: Object that will have only non-private references
:type original_obj: NoteBase
:returns: Nothing
"""
for note_handle in original_obj.get_note_list():
note = db.get_note_from_handle(note_handle)
@ -513,13 +513,13 @@ def copy_associations(db, original_obj, clean_obj):
Copies associations from one object to another - excluding
references to private notes.
@param db: GRAMPS database to which the references belongs
@type db: DbBase
@param original_obj: Object that may have private references
@type original_obj: Base
@param clean_obj: Object that will have only non-private references
@type original_obj: Base
@returns: Nothing
:param db: Gramps database to which the references belongs
:type db: DbBase
:param original_obj: Object that may have private references
:type original_obj: Base
:param clean_obj: Object that will have only non-private references
:type original_obj: Base
:returns: Nothing
"""
new_person_ref_list = []
for person_ref in original_obj.get_person_ref_list():
@ -534,13 +534,13 @@ def copy_attributes(db, original_obj, clean_obj):
Copies attributes from one object to another - excluding references to
private attributes.
@param db: GRAMPS database to which the references belongs
@type db: DbBase
@param original_obj: Object that may have private references
@type original_obj: AttributeBase
@param clean_obj: Object that will have only non-private references
@type original_obj: AttributeBase
@returns: Nothing
:param db: Gramps database to which the references belongs
:type db: DbBase
:param original_obj: Object that may have private references
:type original_obj: AttributeBase
:param clean_obj: Object that will have only non-private references
:type original_obj: AttributeBase
:returns: Nothing
"""
for attribute in original_obj.get_attribute_list():
if attribute and not attribute.get_privacy():
@ -556,13 +556,13 @@ def copy_srcattributes(db, original_obj, clean_obj):
Copies srcattributes from one object to another - excluding references to
private srcattributes.
@param db: GRAMPS database to which the references belongs
@type db: DbBase
@param original_obj: Object that may have private references
@type original_obj: SrcAttributeBase
@param clean_obj: Object that will have only non-private references
@type original_obj: SrcAttributeBase
@returns: Nothing
:param db: Gramps database to which the references belongs
:type db: DbBase
:param original_obj: Object that may have private references
:type original_obj: SrcAttributeBase
:param clean_obj: Object that will have only non-private references
:type original_obj: SrcAttributeBase
:returns: Nothing
"""
for attribute in original_obj.get_attribute_list():
if attribute and not attribute.get_privacy():
@ -576,13 +576,13 @@ def copy_urls(db, original_obj, clean_obj):
Copies urls from one object to another - excluding references to
private urls.
@param db: GRAMPS database to which the references belongs
@type db: DbBase
@param original_obj: Object that may have urls
@type original_obj: UrlBase
@param clean_obj: Object that will have only non-private urls
@type original_obj: UrlBase
@returns: Nothing
:param db: Gramps database to which the references belongs
:type db: DbBase
:param original_obj: Object that may have urls
:type original_obj: UrlBase
:param clean_obj: Object that will have only non-private urls
:type original_obj: UrlBase
:returns: Nothing
"""
for url in original_obj.get_url_list():
if url and not url.get_privacy():
@ -593,13 +593,13 @@ def copy_lds_ords(db, original_obj, clean_obj):
Copies LDS ORDs from one object to another - excluding references to
private LDS ORDs.
@param db: GRAMPS database to which the references belongs
@type db: DbBase
@param original_obj: Object that may have LDS ORDs
@type original_obj: LdsOrdBase
@param clean_obj: Object that will have only non-private LDS ORDs
@type original_obj: LdsOrdBase
@returns: Nothing
:param db: Gramps database to which the references belongs
:type db: DbBase
:param original_obj: Object that may have LDS ORDs
:type original_obj: LdsOrdBase
:param clean_obj: Object that will have only non-private LDS ORDs
:type original_obj: LdsOrdBase
:returns: Nothing
"""
for lds_ord in original_obj.get_lds_ord_list():
if lds_ord and not lds_ord.get_privacy():
@ -610,13 +610,13 @@ def copy_addresses(db, original_obj, clean_obj):
Copies addresses from one object to another - excluding references to
private addresses.
@param db: GRAMPS database to which the references belongs
@type db: DbBase
@param original_obj: Object that may have addresses
@type original_obj: AddressBase
@param clean_obj: Object that will have only non-private addresses
@type original_obj: AddressBase
@returns: Nothing
:param db: Gramps database to which the references belongs
:type db: DbBase
:param original_obj: Object that may have addresses
:type original_obj: AddressBase
:param clean_obj: Object that will have only non-private addresses
:type original_obj: AddressBase
:returns: Nothing
"""
for address in original_obj.get_address_list():
if address and not address.get_privacy():
@ -628,13 +628,13 @@ def sanitize_lds_ord(db, lds_ord):
instance. The returned instance has all private records
removed from it.
@param db: GRAMPS database to which the LdsOrd object belongs
@type db: DbBase
@param name: source LdsOrd object that will be copied with
privacy records removed
@type name: LdsOrd
@returns: 'cleansed' LdsOrd object
@rtype: LdsOrd
:param db: Gramps database to which the LdsOrd object belongs
:type db: DbBase
:param name: source LdsOrd object that will be copied with
privacy records removed
:type name: LdsOrd
:returns: 'cleansed' LdsOrd object
:rtype: LdsOrd
"""
new_lds_ord = LdsOrd()
new_lds_ord.set_type(lds_ord.get_type())
@ -664,13 +664,13 @@ def sanitize_address(db, address):
instance. The returned instance has all private records
removed from it.
@param db: GRAMPS database to which the Person object belongs
@type db: DbBase
@param name: source Address object that will be copied with
privacy records removed
@type name: Address
@returns: 'cleansed' Address object
@rtype: Address
:param db: Gramps database to which the Person object belongs
:type db: DbBase
:param name: source Address object that will be copied with
privacy records removed
:type name: Address
:returns: 'cleansed' Address object
:rtype: Address
"""
new_address = Address()
@ -695,13 +695,13 @@ def sanitize_name(db, name):
instance. The returned instance has all private records
removed from it.
@param db: GRAMPS database to which the Person object belongs
@type db: DbBase
@param name: source Name object that will be copied with
privacy records removed
@type name: Name
@returns: 'cleansed' Name object
@rtype: Name
:param db: Gramps database to which the Person object belongs
:type db: DbBase
:param name: source Name object that will be copied with
privacy records removed
:type name: Name
:returns: 'cleansed' Name object
:rtype: Name
"""
new_name = Name()
new_name.set_group_as(name.get_group_as())
@ -728,13 +728,13 @@ def sanitize_media_ref(db, media_ref):
instance. The returned instance has all private records
removed from it.
@param db: GRAMPS database to which the MediaRef object belongs
@type db: DbBase
@param source_ref: source MediaRef object that will be copied with
privacy records removed
@type source_ref: MediaRef
@returns: 'cleansed' MediaRef object
@rtype: MediaRef
:param db: Gramps database to which the MediaRef object belongs
:type db: DbBase
:param source_ref: source MediaRef object that will be copied with
privacy records removed
:type source_ref: MediaRef
:returns: 'cleansed' MediaRef object
:rtype: MediaRef
"""
new_ref = MediaRef()
new_ref.set_rectangle(media_ref.get_rectangle())
@ -752,13 +752,13 @@ def sanitize_citation(db, citation):
instance. The returned instance has all private records
removed from it.
@param db: GRAMPS database to which the Person object belongs
@type db: DbBase
@param citation: source Citation object that will be copied with
privacy records removed
@type citation: Citation
@returns: 'cleansed' Citation object
@rtype: Citation
:param db: Gramps database to which the Person object belongs
:type db: DbBase
:param citation: source Citation object that will be copied with
privacy records removed
:type citation: Citation
:returns: 'cleansed' Citation object
:rtype: Citation
"""
new_citation = Citation()
new_citation.set_date_object(citation.get_date_object())
@ -780,13 +780,13 @@ def sanitize_event_ref(db, event_ref):
instance. The returned instance has all private records
removed from it.
@param db: GRAMPS database to which the Person object belongs
@type db: DbBase
@param event_ref: source EventRef object that will be copied with
privacy records removed
@type event_ref: EventRef
@returns: 'cleansed' EventRef object
@rtype: EventRef
:param db: Gramps database to which the Person object belongs
:type db: DbBase
:param event_ref: source EventRef object that will be copied with
privacy records removed
:type event_ref: EventRef
:returns: 'cleansed' EventRef object
:rtype: EventRef
"""
new_ref = EventRef()
@ -803,13 +803,13 @@ def sanitize_person(db, person):
instance. The returned instance has all private records
removed from it.
@param db: GRAMPS database to which the Person object belongs
@type db: DbBase
@param person: source Person object that will be copied with
privacy records removed
@type person: Person
@returns: 'cleansed' Person object
@rtype: Person
:param db: Gramps database to which the Person object belongs
:type db: DbBase
:param person: source Person object that will be copied with
privacy records removed
:type person: Person
:returns: 'cleansed' Person object
:rtype: Person
"""
new_person = Person()
@ -896,13 +896,13 @@ def sanitize_source(db, source):
instance. The returned instance has all private records
removed from it.
@param db: GRAMPS database to which the Person object belongs
@type db: DbBase
@param source: source Source object that will be copied with
privacy records removed
@type source: Source
@returns: 'cleansed' Source object
@rtype: Source
:param db: Gramps database to which the Person object belongs
:type db: DbBase
:param source: source Source object that will be copied with
privacy records removed
:type source: Source
:returns: 'cleansed' Source object
:rtype: Source
"""
new_source = Source()
@ -933,13 +933,13 @@ def sanitize_media(db, media):
instance. The returned instance has all private records
removed from it.
@param db: GRAMPS database to which the Person object belongs
@type db: DbBase
@param media: source Media object that will be copied with
privacy records removed
@type media: MediaObject
@returns: 'cleansed' Media object
@rtype: MediaObject
:param db: Gramps database to which the Person object belongs
:type db: DbBase
:param media: source Media object that will be copied with
privacy records removed
:type media: MediaObject
:returns: 'cleansed' Media object
:rtype: MediaObject
"""
new_media = MediaObject()
@ -964,13 +964,13 @@ def sanitize_place(db, place):
instance. The returned instance has all private records
removed from it.
@param db: GRAMPS database to which the Person object belongs
@type db: DbBase
@param place: source Place object that will be copied with
privacy records removed
@type place: Place
@returns: 'cleansed' Place object
@rtype: Place
:param db: Gramps database to which the Person object belongs
:type db: DbBase
:param place: source Place object that will be copied with
privacy records removed
:type place: Place
:returns: 'cleansed' Place object
:rtype: Place
"""
new_place = Place()
@ -999,13 +999,13 @@ def sanitize_event(db, event):
instance. The returned instance has all private records
removed from it.
@param db: GRAMPS database to which the Person object belongs
@type db: DbBase
@param event: source Event object that will be copied with
privacy records removed
@type event: Event
@returns: 'cleansed' Event object
@rtype: Event
:param db: Gramps database to which the Person object belongs
:type db: DbBase
:param event: source Event object that will be copied with
privacy records removed
:type event: Event
:returns: 'cleansed' Event object
:rtype: Event
"""
new_event = Event()
@ -1034,13 +1034,13 @@ def sanitize_family(db, family):
instance. The returned instance has all private records
removed from it.
@param db: GRAMPS database to which the Person object belongs
@type db: DbBase
@param family: source Family object that will be copied with
privacy records removed
@type family: Family
@returns: 'cleansed' Family object
@rtype: Family
:param db: Gramps database to which the Person object belongs
:type db: DbBase
:param family: source Family object that will be copied with
privacy records removed
:type family: Family
:returns: 'cleansed' Family object
:rtype: Family
"""
new_family = Family()
@ -1102,13 +1102,13 @@ def sanitize_repository(db, repository):
instance. The returned instance has all private records
removed from it.
@param db: GRAMPS database to which the Person object belongs
@type db: DbBase
@param repository: source Repository object that will be copied with
privacy records removed
@type repository: Repository
@returns: 'cleansed' Repository object
@rtype: Repository
:param db: Gramps database to which the Person object belongs
:type db: DbBase
:param repository: source Repository object that will be copied with
privacy records removed
:type repository: Repository
:returns: 'cleansed' Repository object
:rtype: Repository
"""
new_repository = Repository()

View File

@ -22,7 +22,7 @@
# $Id$
"""
Proxy class for the GRAMPS databases. Filter out all data marked private.
Proxy class for the Gramps databases. Filter out all data marked private.
"""
#-------------------------------------------------------------------------

View File

@ -22,7 +22,7 @@
# $Id$
"""
Proxy class for the GRAMPS databases. Returns objects which are
Proxy class for the Gramps databases. Returns objects which are
referenced by a person, or through a chain of references starting with
a person.
"""
@ -46,9 +46,10 @@ class ReferencedBySelectionProxyDb(ProxyDbBase):
"""
Create a new ReferencedByPeopleProxyDb instance.
all_people - if True, get all people, and the items they link
to; if False, get all people that are connected to something,
and all of items they link to.
:param all_people: if True, get all people, and the items they link to;
if False, get all people that are connected to
something, and all of items they link to.
:type all_people: boolean
"""
ProxyDbBase.__init__(self, dbase)
self.reset_references()