Added a convienence method __len__ for cursors; you can remove if you don't like

svn: r12912
This commit is contained in:
Doug Blank 2009-08-07 09:11:13 +00:00
parent 2343bb9da5
commit dd1f4f0b26

View File

@ -105,6 +105,12 @@ class GrampsCursor(object):
Return the number of records in the table referenced by the cursor.
"""
return self.source.stat()['ndata']
def __len__(self):
"""
Convienence method to work with len(cursor).
"""
return self.get_length()
def __iter__(self):
"""