Added a convienence method __len__ for cursors; you can remove if you don't like
svn: r12912
This commit is contained in:
parent
2343bb9da5
commit
dd1f4f0b26
@ -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):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user