From dd1f4f0b2650408a59782ffe34ba713220f1234d Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Fri, 7 Aug 2009 09:11:13 +0000 Subject: [PATCH] Added a convienence method __len__ for cursors; you can remove if you don't like svn: r12912 --- src/gen/db/cursor.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gen/db/cursor.py b/src/gen/db/cursor.py index 7569a69cd..92af2f42b 100644 --- a/src/gen/db/cursor.py +++ b/src/gen/db/cursor.py @@ -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): """