clarify use of all_handles methods

svn: r21813
This commit is contained in:
Benny Malengier 2013-03-29 20:02:54 +00:00
parent 7be12778b2
commit 491885b419

View File

@ -968,6 +968,11 @@ class DbBsddbRead(DbReadBase, Callback):
return self.get_number_of_records(self.tag_map)
def all_handles(self, table):
""" return all the keys of a database table
CAREFUL: For speed the keys are directly returned, so on python3
bytestrings are returned! Use constfunc.py handle2internal
on this result!
"""
return table.keys(txn=self.txn)
def get_person_handles(self, sort_handles=False):
@ -976,6 +981,10 @@ class DbBsddbRead(DbReadBase, Callback):
the database.
If sort_handles is True, the list is sorted by surnames.
CAREFUL: For speed the keys are directly returned, so on python3
bytestrings are returned! Use constfunc.py handle2internal
on this result!
"""
if self.db_is_open:
handle_list = self.all_handles(self.person_map)
@ -990,6 +999,10 @@ class DbBsddbRead(DbReadBase, Callback):
the database.
If sort_handles is True, the list is sorted by Place title.
CAREFUL: For speed the keys are directly returned, so on python3
bytestrings are returned! Use constfunc.py handle2internal
on this result!
"""
if self.db_is_open:
@ -1005,6 +1018,10 @@ class DbBsddbRead(DbReadBase, Callback):
the database.
If sort_handles is True, the list is sorted by Source title.
CAREFUL: For speed the keys are directly returned, so on python3
bytestrings are returned! Use constfunc.py handle2internal
on this result!
"""
if self.db_is_open:
handle_list = self.all_handles(self.source_map)
@ -1019,6 +1036,10 @@ class DbBsddbRead(DbReadBase, Callback):
the database.
If sort_handles is True, the list is sorted by Citation Volume/Page.
CAREFUL: For speed the keys are directly returned, so on python3
bytestrings are returned! Use constfunc.py handle2internal
on this result!
"""
if self.db_is_open:
handle_list = self.all_handles(self.citation_map)
@ -1033,6 +1054,10 @@ class DbBsddbRead(DbReadBase, Callback):
the database.
If sort_handles is True, the list is sorted by title.
CAREFUL: For speed the keys are directly returned, so on python3
bytestrings are returned! Use constfunc.py handle2internal
on this result!
"""
if self.db_is_open:
handle_list = self.all_handles(self.media_map)
@ -1045,6 +1070,10 @@ class DbBsddbRead(DbReadBase, Callback):
"""
Return a list of database handles, one handle for each Event in the
database.
CAREFUL: For speed the keys are directly returned, so on python3
bytestrings are returned! Use constfunc.py handle2internal
on this result!
"""
if self.db_is_open:
return self.all_handles(self.event_map)
@ -1054,6 +1083,10 @@ class DbBsddbRead(DbReadBase, Callback):
"""
Return a list of database handles, one handle for each Family in
the database.
CAREFUL: For speed the keys are directly returned, so on python3
bytestrings are returned! Use constfunc.py handle2internal
on this result!
"""
if self.db_is_open:
return self.all_handles(self.family_map)
@ -1063,6 +1096,10 @@ class DbBsddbRead(DbReadBase, Callback):
"""
Return a list of database handles, one handle for each Repository in
the database.
CAREFUL: For speed the keys are directly returned, so on python3
bytestrings are returned! Use constfunc.py handle2internal
on this result!
"""
if self.db_is_open:
return self.all_handles(self.repository_map)
@ -1072,6 +1109,10 @@ class DbBsddbRead(DbReadBase, Callback):
"""
Return a list of database handles, one handle for each Note in the
database.
CAREFUL: For speed the keys are directly returned, so on python3
bytestrings are returned! Use constfunc.py handle2internal
on this result!
"""
if self.db_is_open:
return self.all_handles(self.note_map)
@ -1083,6 +1124,10 @@ class DbBsddbRead(DbReadBase, Callback):
the database.
If sort_handles is True, the list is sorted by Tag name.
CAREFUL: For speed the keys are directly returned, so on python3
bytestrings are returned! Use constfunc.py handle2internal
on this result!
"""
if self.db_is_open:
handle_list = self.all_handles(self.tag_map)