Package gen :: Package db :: Module dbdir :: Class GrampsDBDir
[frames] | no frames]

Class GrampsDBDir

source code


GRAMPS database object.

This object is a base class for other objects.

Instance Methods
 
__init__(self)
Create a new GrampsDB.
source code
 
all_handles(self, table) source code
 
get_person_cursor(self) source code
 
get_family_cursor(self) source code
 
get_event_cursor(self) source code
 
get_place_cursor(self) source code
 
get_source_cursor(self) source code
 
get_media_cursor(self) source code
 
get_repository_cursor(self) source code
 
get_note_cursor(self) source code
 
has_person_handle(self, handle)
Return True if the handle exists in the current Person database.
source code
 
has_family_handle(self, handle)
Return True if the handle exists in the current Family database.
source code
 
has_object_handle(self, handle)
Return True if the handle exists in the current MediaObjectdatabase.
source code
 
has_repository_handle(self, handle)
Return True if the handle exists in the current Repository database.
source code
 
has_note_handle(self, handle)
Return True if the handle exists in the current Note database.
source code
 
has_event_handle(self, handle)
Return True if the handle exists in the current Event database.
source code
 
has_place_handle(self, handle)
Return True if the handle exists in the current Place database.
source code
 
has_source_handle(self, handle)
Return True if the handle exists in the current Source database.
source code
 
get_raw_person_data(self, handle) source code
 
get_raw_family_data(self, handle) source code
 
get_raw_object_data(self, handle) source code
 
get_raw_place_data(self, handle) source code
 
get_raw_event_data(self, handle) source code
 
get_raw_source_data(self, handle) source code
 
get_raw_repository_data(self, handle) source code
 
get_raw_note_data(self, handle) source code
 
get_reference_map_cursor(self) source code
 
get_reference_map_primary_cursor(self) source code
 
get_reference_map_referenced_cursor(self) source code
 
set_default_person_handle(self, handle)
Set the default Person to the passed instance.
source code
 
get_default_person(self)
Return the default Person of the database.
source code
 
set_mediapath(self, path)
Set the default media path for database, path should be utf-8.
source code
 
set_column_order(self, col_list, name) source code
 
version_supported(self)
Return True when the file has a supported version.
source code
 
need_upgrade(self) source code
 
load(self, name, callback, mode='w')
Open the specified database.
source code
 
open_undodb(self)
Override method from GrampsDbBase because in DIR setup we want the undo database to be inside the dir.
source code
 
load_from(self, other_database, filename, callback)
Load data from the other database into itself.
source code
 
rebuild_secondary(self, callback=None) source code
 
find_backlink_handles(self, handle, include_classes=None)
Find all objects that hold a reference to the object handle.
source code
 
delete_primary_from_reference_map(self, handle, transaction, txn=None)
Remove all references to the primary object from the reference_map.
source code
 
update_reference_map(self, obj, transaction, txn=None)
If txn is given, then changes are written right away using txn.
source code
 
reindex_reference_map(self, callback)
Reindex all primary records in the database.
source code
 
close(self)
Close the specified database.
source code
 
do_remove_object(self, handle, transaction, data_map, key, del_list) source code
 
del_person(self, handle) source code
 
del_source(self, handle) source code
 
del_repository(self, handle) source code
 
del_note(self, handle) source code
 
del_place(self, handle) source code
 
del_media(self, handle) source code
 
del_family(self, handle) source code
 
del_event(self, handle) source code
 
set_name_group_mapping(self, name, group)
Make name group under the value of group.
source code
 
build_surname_list(self)
Build the list of locale-sorted surnames contained in the database.
source code
 
remove_from_surname_list(self, person)
Check whether there are persons with the same surname left in the database.
source code
 
get_person_from_gramps_id(self, val)
Find a Person in the database from the passed gramps' ID.
source code
 
get_family_from_gramps_id(self, val)
Find a Family in the database from the passed gramps' ID.
source code
 
get_event_from_gramps_id(self, val)
Find an Event in the database from the passed gramps' ID.
source code
 
get_place_from_gramps_id(self, val)
Find a Place in the database from the passed gramps' ID.
source code
 
get_source_from_gramps_id(self, val)
Find a Source in the database from the passed gramps' ID.
source code
 
get_object_from_gramps_id(self, val)
Find a MediaObject in the database from the passed gramps' ID.
source code
 
get_repository_from_gramps_id(self, val)
Find a Repository in the database from the passed gramps' ID.
source code
 
get_note_from_gramps_id(self, val)
Find a Note in the database from the passed gramps' ID.
source code
 
commit_base(self, obj, data_map, key, update_list, add_list, transaction, change_time)
Commit the specified object to the database, storing the changes as part of the transaction.
source code
 
do_commit(self, add_list, db_map) source code
 
get_from_handle(self, handle, class_type, data_map) source code
tuple
find_from_handle(self, handle, transaction, class_type, dmap, add_func)
Find a object of class_type in the database from the passed handle.
source code
 
transaction_begin(self, msg='', batch=False, no_magic=False)
Create a new Transaction tied to the current UNDO database.
source code
 
transaction_commit(self, transaction, msg)
Commit the transaction to the assocated UNDO database.
source code
 
undo(self, update_history=True)
Access the last committed transaction, and revert the data to the state before the transaction was committed.
source code
 
redo(self, update_history=True)
Accesse the last undone transaction, and revert the data to the state before the transaction was undone.
source code
 
undo_reference(self, data, handle) source code
 
undo_data(self, data, handle, db_map, signal_root) source code
 
gramps_upgrade(self, callback=None) source code

Inherited from base.GrampsDbBase: add_event, add_family, add_family_event, add_note, add_object, add_person, add_person_event, add_place, add_repository, add_source, add_to_surname_list, check_event_from_handle, check_family_from_handle, check_note_from_handle, check_object_from_handle, check_person_from_handle, check_place_from_handle, check_repository_from_handle, check_source_from_handle, close_undodb, commit_event, commit_family, commit_family_event, commit_media_object, commit_note, commit_person, commit_personal_event, commit_place, commit_repository, commit_source, create_id, db_has_bm_changes, find_event_from_handle, find_family_from_handle, find_initial_person, find_next_event_gramps_id, find_next_family_gramps_id, find_next_note_gramps_id, find_next_object_gramps_id, find_next_person_gramps_id, find_next_place_gramps_id, find_next_repository_gramps_id, find_next_source_gramps_id, find_note_from_handle, find_object_from_handle, find_person_from_handle, find_place_from_handle, find_repository_from_handle, find_source_from_handle, get_bookmarks, get_child_column_order, get_child_reference_types, get_default_handle, get_del_func, get_event_bookmarks, get_event_column_order, get_event_cursor_iter, get_event_from_handle, get_event_handles, get_event_roles, get_family_attribute_types, get_family_bookmarks, get_family_cursor_iter, get_family_event_types, get_family_from_handle, get_family_handles, get_family_list_column_order, get_family_relation_types, get_gramps_ids, get_marker_types, get_media_attribute_types, get_media_bookmarks, get_media_column_order, get_media_cursor_iter, get_media_object_handles, get_mediapath, get_name_group_keys, get_name_group_mapping, get_name_types, get_note_bookmarks, get_note_column_order, get_note_cursor_iter, get_note_from_handle, get_note_handles, get_note_types, get_number_of_events, get_number_of_families, get_number_of_media_objects, get_number_of_notes, get_number_of_people, get_number_of_places, get_number_of_repositories, get_number_of_sources, get_object_from_handle, get_person_attribute_types, get_person_column_order, get_person_cursor_iter, get_person_event_types, get_person_from_handle, get_person_handles, get_place_bookmarks, get_place_column_order, get_place_cursor_iter, get_place_from_handle, get_place_handles, get_repo_bookmarks, get_repository_column_order, get_repository_cursor_iter, get_repository_from_handle, get_repository_handles, get_repository_types, get_researcher, get_save_path, get_source_bookmarks, get_source_column_order, get_source_cursor_iter, get_source_from_handle, get_source_handles, get_source_media_types, get_surname_list, get_url_types, has_gramps_id, has_name_group_key, is_open, redo_available, remove_event, remove_family, remove_note, remove_object, remove_person, remove_place, remove_repository, remove_source, report_bm_change, request_rebuild, set_child_column_order, set_event_column_order, set_event_id_prefix, set_family_id_prefix, set_family_list_column_order, set_media_column_order, set_note_column_order, set_note_id_prefix, set_object_id_prefix, set_person_column_order, set_person_id_prefix, set_place_column_order, set_place_id_prefix, set_prefixes, set_redo_callback, set_repository_column_order, set_repository_id_prefix, set_researcher, set_save_path, set_source_column_order, set_source_id_prefix, set_undo_callback, sort_surname_list, undo_available

Inherited from utils.callback.Callback: connect, disable_logging, disable_signals, disconnect, emit, enable_logging, enable_signals

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Inherited from BasicUtils._UpdateCallback.UpdateCallback: reset, set_total, update_empty, update_real

Class Methods

Inherited from utils.callback.Callback: disable_all_signals, enable_all_signals, log_all

Class Variables

Inherited from base.GrampsDbBase: __config__, __signals__

Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

Create a new GrampsDB.

Parameters:
  • callback - a function with one arg to execute every so often
  • interval - number of seconds at most between the updates
Overrides: BasicUtils._UpdateCallback.UpdateCallback.__init__

all_handles(self, table)

source code 
Overrides: base.GrampsDbBase.all_handles

get_person_cursor(self)

source code 
Overrides: base.GrampsDbBase.get_person_cursor

get_family_cursor(self)

source code 
Overrides: base.GrampsDbBase.get_family_cursor

get_event_cursor(self)

source code 
Overrides: base.GrampsDbBase.get_event_cursor

get_place_cursor(self)

source code 
Overrides: base.GrampsDbBase.get_place_cursor

get_source_cursor(self)

source code 
Overrides: base.GrampsDbBase.get_source_cursor

get_media_cursor(self)

source code 
Overrides: base.GrampsDbBase.get_media_cursor

get_repository_cursor(self)

source code 
Overrides: base.GrampsDbBase.get_repository_cursor

get_note_cursor(self)

source code 
Overrides: base.GrampsDbBase.get_note_cursor

has_person_handle(self, handle)

source code 

Return True if the handle exists in the current Person database.

Overrides: base.GrampsDbBase.has_person_handle

has_family_handle(self, handle)

source code 

Return True if the handle exists in the current Family database.

Overrides: base.GrampsDbBase.has_family_handle

has_object_handle(self, handle)

source code 

Return True if the handle exists in the current MediaObjectdatabase.

Overrides: base.GrampsDbBase.has_object_handle

has_repository_handle(self, handle)

source code 

Return True if the handle exists in the current Repository database.

Overrides: base.GrampsDbBase.has_repository_handle

has_note_handle(self, handle)

source code 

Return True if the handle exists in the current Note database.

Overrides: base.GrampsDbBase.has_note_handle

has_event_handle(self, handle)

source code 

Return True if the handle exists in the current Event database.

Overrides: base.GrampsDbBase.has_event_handle

has_place_handle(self, handle)

source code 

Return True if the handle exists in the current Place database.

Overrides: base.GrampsDbBase.has_place_handle

has_source_handle(self, handle)

source code 

Return True if the handle exists in the current Source database.

Overrides: base.GrampsDbBase.has_source_handle

get_raw_person_data(self, handle)

source code 
Overrides: base.GrampsDbBase.get_raw_person_data

get_raw_family_data(self, handle)

source code 
Overrides: base.GrampsDbBase.get_raw_family_data

get_raw_object_data(self, handle)

source code 
Overrides: base.GrampsDbBase.get_raw_object_data

get_raw_place_data(self, handle)

source code 
Overrides: base.GrampsDbBase.get_raw_place_data

get_raw_event_data(self, handle)

source code 
Overrides: base.GrampsDbBase.get_raw_event_data

get_raw_source_data(self, handle)

source code 
Overrides: base.GrampsDbBase.get_raw_source_data

get_raw_repository_data(self, handle)

source code 
Overrides: base.GrampsDbBase.get_raw_repository_data

get_raw_note_data(self, handle)

source code 
Overrides: base.GrampsDbBase.get_raw_note_data

set_default_person_handle(self, handle)

source code 

Set the default Person to the passed instance.

Overrides: base.GrampsDbBase.set_default_person_handle
(inherited documentation)

get_default_person(self)

source code 

Return the default Person of the database.

Overrides: base.GrampsDbBase.get_default_person
(inherited documentation)

set_mediapath(self, path)

source code 

Set the default media path for database, path should be utf-8.

Overrides: base.GrampsDbBase.set_mediapath

set_column_order(self, col_list, name)

source code 
Overrides: base.GrampsDbBase.set_column_order

version_supported(self)

source code 

Return True when the file has a supported version.

Overrides: base.GrampsDbBase.version_supported
(inherited documentation)

need_upgrade(self)

source code 
Overrides: base.GrampsDbBase.need_upgrade

load(self, name, callback, mode='w')

source code 

Open the specified database.

The method needs to be overridden in the derived class.

Overrides: base.GrampsDbBase.load
(inherited documentation)

open_undodb(self)

source code 

Override method from GrampsDbBase because in DIR setup we want the undo database to be inside the dir.

Overrides: base.GrampsDbBase.open_undodb

load_from(self, other_database, filename, callback)

source code 

Load data from the other database into itself.

The filename is the name of the file for the newly created database. The method needs to be overridden in the derived class.

Overrides: base.GrampsDbBase.load_from
(inherited documentation)

rebuild_secondary(self, callback=None)

source code 
Overrides: base.GrampsDbBase.rebuild_secondary

find_backlink_handles(self, handle, include_classes=None)

source code 

Find all objects that hold a reference to the object handle.

Returns an interator over alist of (class_name, handle) tuples.

Parameters:
  • handle - handle of the object to search for.
  • include_classes - list of class names to include in the results. Default: None means include all classes.
Overrides: base.GrampsDbBase.find_backlink_handles
(inherited documentation)

delete_primary_from_reference_map(self, handle, transaction, txn=None)

source code 

Remove all references to the primary object from the reference_map.

Overrides: base.GrampsDbBase.delete_primary_from_reference_map

update_reference_map(self, obj, transaction, txn=None)

source code 

If txn is given, then changes are written right away using txn.

Overrides: base.GrampsDbBase.update_reference_map

reindex_reference_map(self, callback)

source code 

Reindex all primary records in the database.

Overrides: base.GrampsDbBase.reindex_reference_map
(inherited documentation)

close(self)

source code 

Close the specified database.

The method needs to be overridden in the derived class.

Overrides: base.GrampsDbBase.close
(inherited documentation)

do_remove_object(self, handle, transaction, data_map, key, del_list)

source code 
Overrides: base.GrampsDbBase.do_remove_object

del_person(self, handle)

source code 
Overrides: base.GrampsDbBase.del_person

del_source(self, handle)

source code 
Overrides: base.GrampsDbBase.del_source

del_repository(self, handle)

source code 
Overrides: base.GrampsDbBase.del_repository

del_note(self, handle)

source code 
Overrides: base.GrampsDbBase.del_note

del_place(self, handle)

source code 
Overrides: base.GrampsDbBase.del_place

del_media(self, handle)

source code 
Overrides: base.GrampsDbBase.del_media

del_family(self, handle)

source code 
Overrides: base.GrampsDbBase.del_family

del_event(self, handle)

source code 
Overrides: base.GrampsDbBase.del_event

set_name_group_mapping(self, name, group)

source code 

Make name group under the value of group.

If group =None, the old grouping is deleted.

Overrides: base.GrampsDbBase.set_name_group_mapping

build_surname_list(self)

source code 

Build the list of locale-sorted surnames contained in the database.

The function must be overridden in the derived class.

Overrides: base.GrampsDbBase.build_surname_list
(inherited documentation)

remove_from_surname_list(self, person)

source code 

Check whether there are persons with the same surname left in the database.

If not then we need to remove the name from the list. The function must be overridden in the derived class.

Overrides: base.GrampsDbBase.remove_from_surname_list

get_person_from_gramps_id(self, val)

source code 

Find a Person in the database from the passed gramps' ID.

If no such Person exists, None is returned.

Overrides: base.GrampsDbBase.get_person_from_gramps_id

get_family_from_gramps_id(self, val)

source code 

Find a Family in the database from the passed gramps' ID.

If no such Family exists, None is return.

Overrides: base.GrampsDbBase.get_family_from_gramps_id

get_event_from_gramps_id(self, val)

source code 

Find an Event in the database from the passed gramps' ID.

If no such Family exists, None is returned.

Overrides: base.GrampsDbBase.get_event_from_gramps_id

get_place_from_gramps_id(self, val)

source code 

Find a Place in the database from the passed gramps' ID.

If no such Place exists, None is returned.

Overrides: base.GrampsDbBase.get_place_from_gramps_id

get_source_from_gramps_id(self, val)

source code 

Find a Source in the database from the passed gramps' ID.

If no such Source exists, None is returned.

Overrides: base.GrampsDbBase.get_source_from_gramps_id

get_object_from_gramps_id(self, val)

source code 

Find a MediaObject in the database from the passed gramps' ID.

If no such MediaObject exists, None is returned.

Overrides: base.GrampsDbBase.get_object_from_gramps_id

get_repository_from_gramps_id(self, val)

source code 

Find a Repository in the database from the passed gramps' ID.

If no such Repository exists, None is returned.

Overrides: base.GrampsDbBase.get_repository_from_gramps_id

get_note_from_gramps_id(self, val)

source code 

Find a Note in the database from the passed gramps' ID.

If no such Note exists, None is returned.

Overrides: base.GrampsDbBase.get_note_from_gramps_id

commit_base(self, obj, data_map, key, update_list, add_list, transaction, change_time)

source code 

Commit the specified object to the database, storing the changes as part of the transaction.

Overrides: base.GrampsDbBase.commit_base

do_commit(self, add_list, db_map)

source code 
Overrides: base.GrampsDbBase.do_commit

get_from_handle(self, handle, class_type, data_map)

source code 
Overrides: base.GrampsDbBase.get_from_handle

find_from_handle(self, handle, transaction, class_type, dmap, add_func)

source code 

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: tuple
Returns a tuple, first the object, second a bool which is True if the object is new
Overrides: base.GrampsDbBase.find_from_handle

transaction_begin(self, msg='', batch=False, no_magic=False)

source code 

Create a new Transaction tied to the current UNDO database.

The transaction has no effect until it is committed using the transaction_commit function of the this database object.

Overrides: base.GrampsDbBase.transaction_begin
(inherited documentation)

transaction_commit(self, transaction, msg)

source code 

Commit the transaction to the assocated UNDO database.

Overrides: base.GrampsDbBase.transaction_commit
(inherited documentation)

undo(self, update_history=True)

source code 

Access the last committed transaction, and revert the data to the state before the transaction was committed.

Overrides: base.GrampsDbBase.undo
(inherited documentation)

redo(self, update_history=True)

source code 

Accesse the last undone transaction, and revert the data to the state before the transaction was undone.

Overrides: base.GrampsDbBase.redo
(inherited documentation)

undo_reference(self, data, handle)

source code 
Overrides: base.GrampsDbBase.undo_reference

undo_data(self, data, handle, db_map, signal_root)

source code 
Overrides: base.GrampsDbBase.undo_data

gramps_upgrade(self, callback=None)

source code 
Overrides: base.GrampsDbBase.gramps_upgrade