Remove unused methods

svn: r13159
This commit is contained in:
Gerald Britton 2009-09-04 17:57:00 +00:00
parent 20bfbc8719
commit 06458ae1d7
2 changed files with 7 additions and 334 deletions

View File

@ -428,187 +428,6 @@ class GrampsDbBase(object):
"""
raise NotImplementedError
def find_from_handle(self, handle, transaction, class_type, dmap,
add_func):
"""
Find a object of class_type in the database from the passed handle.
If no object exists, a new object is added to the database.
:returns: Returns a tuple, first the object, second a bool which is True
if the object is new
"""
raise NotImplementedError
def find_person_from_handle(self, handle, transaction):
"""
Find a Person in the database from the passed handle.
If no such Person exists, a new Person is added to the database.
:returns: Returns a tuple, first the object, second a bool which is True
if the object is new
"""
raise NotImplementedError
def find_source_from_handle(self, handle, transaction):
"""
Find a Source in the database from the passed handle.
If no such Source exists, a new Source is added to the database.
:returns: Returns a tuple, first the object, second a bool which is True
if the object is new
"""
raise NotImplementedError
def find_event_from_handle(self, handle, transaction):
"""
Find a Event in the database from the passed handle.
If no such Event exists, a new Event is added to the database.
:returns: Returns a tuple, first the object, second a bool which is True
if the object is new
"""
raise NotImplementedError
def find_object_from_handle(self, handle, transaction):
"""
Find a MediaObject in the database from the passed handle.
If no such MediaObject exists, a new Object is added to the database.
:returns: Returns a tuple, first the object, second a bool which is True
if the object is new
"""
raise NotImplementedError
def find_place_from_handle(self, handle, transaction):
"""
Find a Place in the database from the passed handle.
If no such Place exists, a new Place is added to the database.
:returns: Returns a tuple, first the object, second a bool which is True
if the object is new
"""
raise NotImplementedError
def find_family_from_handle(self, handle, transaction):
"""
Find a Family in the database from the passed handle.
If no such Family exists, a new Family is added to the database.
:returns: Returns a tuple, first the object, second a bool which is True
if the object is new
"""
raise NotImplementedError
def find_repository_from_handle(self, handle, transaction):
"""
Find a Repository in the database from the passed handle.
If no such Repository exists, a new Repository is added to the database.
:returns: Returns a tuple, first the object, second a bool which is True
if the object is new
"""
raise NotImplementedError
def find_note_from_handle(self, handle, transaction):
"""
Find a Note in the database from the passed handle.
If no such Note exists, a new Note is added to the database.
:returns: Returns a tuple, first the object, second a bool which is True
if the object is new
"""
raise NotImplementedError
def check_person_from_handle(self, handle, transaction, set_gid=True):
"""
Check whether a Person with the passed handle exists in the database.
If no such Person exists, a new Person is added to the database.
If set_gid then a new gramps_id is created, if not, None is used.
"""
raise NotImplementedError
def check_source_from_handle(self, handle, transaction, set_gid=True):
"""
Check whether a Source with the passed handle exists in the database.
If no such Source exists, a new Source is added to the database.
If set_gid then a new gramps_id is created, if not, None is used.
"""
raise NotImplementedError
def check_event_from_handle(self, handle, transaction, set_gid=True):
"""
Check whether an Event with the passed handle exists in the database.
If no such Event exists, a new Event is added to the database.
If set_gid then a new gramps_id is created, if not, None is used.
"""
raise NotImplementedError
def check_object_from_handle(self, handle, transaction, set_gid=True):
"""
Check whether a MediaObject with the passed handle exists in the
database.
If no such MediaObject exists, a new Object is added to the database.
If set_gid then a new gramps_id is created, if not, None is used.
"""
raise NotImplementedError
def check_place_from_handle(self, handle, transaction, set_gid=True):
"""
Check whether a Place with the passed handle exists in the database.
If no such Place exists, a new Place is added to the database.
If set_gid then a new gramps_id is created, if not, None is used.
"""
raise NotImplementedError
def check_family_from_handle(self, handle, transaction, set_gid=True):
"""
Check whether a Family with the passed handle exists in the database.
If no such Family exists, a new Family is added to the database.
If set_gid then a new gramps_id is created, if not, None is used.
"""
raise NotImplementedError
def check_repository_from_handle(self, handle, transaction, set_gid=True):
"""
Check whether a Repository with the passed handle exists in the
database.
If no such Repository exists, a new Repository is added to the database.
If set_gid then a new gramps_id is created, if not, None is used.
"""
raise NotImplementedError
def check_note_from_handle(self, handle, transaction, set_gid=True):
"""
Check whether a Note with the passed handle exists in the database.
If no such Note exists, a new Note is added to the database.
If set_gid then a new gramps_id is created, if not, None is used.
"""
raise NotImplementedError
def get_person_from_gramps_id(self, val):
"""
Find a Person in the database from the passed GRAMPS ID.

View File

@ -77,14 +77,16 @@ class ProxyDbBase(GrampsDbBase):
the owner of the database"""
return self.db.get_researcher()
def include_something(self, handle, object=None):
def include_something(self, handle, obj=None):
"""
Model predicate. Returns True if object referred to by handle is to be
included, otherwise returns False.
"""
if object is None:
object = self.get_something_from_handle(handle)
return object.include()
if obj is None:
obj = self.get_unfiltered_something(handle)
# Call function to determine if object should be included or not
return obj.include()
# Define default predicates for each object type
@ -304,7 +306,7 @@ class ProxyDbBase(GrampsDbBase):
Returns obj if predicate is True or not callable, else returns None
"""
if predicate is not None:
return obj if predicate(obj) else None
return obj if predicate(obj.handle) else None
return obj
def __getattr__(self, name):
@ -676,154 +678,6 @@ class ProxyDbBase(GrampsDbBase):
"""returns the default media path of the database"""
return self.db.get_mediapath()
def set_column_order(self, col_list, name):
raise NotImplementedError
def set_person_column_order(self, col_list):
"""
Stores the Person display common information in the
database's metadata.
"""
raise NotImplementedError
def set_family_list_column_order(self, col_list):
"""
Stores the Person display common information in the
database's metadata.
"""
raise NotImplementedError
def set_child_column_order(self, col_list):
"""
Stores the Person display common information in the
database's metadata.
"""
raise NotImplementedError
def set_place_column_order(self, col_list):
"""
Stores the Place display common information in the
database's metadata.
"""
raise NotImplementedError
def set_source_column_order(self, col_list):
"""
Stores the Source display common information in the
database's metadata.
"""
raise NotImplementedError
def set_media_column_order(self, col_list):
"""
Stores the Media display common information in the
database's metadata.
"""
raise NotImplementedError
def set_event_column_order(self, col_list):
"""
Stores the Event display common information in the
database's metadata.
"""
raise NotImplementedError
def set_repository_column_order(self, col_list):
"""
Stores the Repository display common information in the
database's metadata.
"""
raise NotImplementedError
def set_note_column_order(self, col_list):
"""
Stores the Note display common information in the
database's metadata.
"""
raise NotImplementedError
def get_person_column_order(self):
"""
Return the Person display common information stored in the
database's metadata.
"""
raise NotImplementedError
def get_family_list_column_order(self):
"""
Return the Person display common information stored in the
database's metadata.
"""
raise NotImplementedError
def get_child_column_order(self):
"""
Return the Person display common information stored in the
database's metadata.
"""
raise NotImplementedError
def get_place_column_order(self):
"""
Return the Place display common information stored in the
database's metadata.
"""
raise NotImplementedError
def get_source_column_order(self):
"""
Return the Source display common information stored in the
database's metadata.
"""
raise NotImplementedError
def get_media_column_order(self):
"""
Return the MediaObject display common information stored in the
database's metadata.
"""
raise NotImplementedError
def get_event_column_order(self):
"""
Return the Event display common information stored in the
database's metadata.
"""
raise NotImplementedError
def get_repository_column_order(self):
"""
Return the Repository display common information stored in the
database's metadata.
"""
raise NotImplementedError
def get_note_column_order(self):
"""
Return the Note display common information stored in the
database's metadata.
"""
raise NotImplementedError
def delete_primary_from_reference_map(self, handle, transaction):
"""Called each time an object is removed from the database. This can
be used by subclasses to update any additional index tables that might
need to be changed."""
raise NotImplementedError
def update_reference_map(self, obj, transaction):
"""Called each time an object is writen to the database. This can
be used by subclasses to update any additional index tables that might
need to be changed."""
raise NotImplementedError
def reindex_reference_map(self, callback):
"""
Reindex all primary records in the database.
"""
raise NotImplementedError
def find_backlink_handles(self, handle, include_classes=None):
"""
Find all objects that hold a reference to the object handle.