(self, function, filter=lambda: True, *args, **kwargs)
call function once for each sheet
call function once for each sheet
call function once for each sheet
def iterate(self, function, filter=lambda: True, *args, **kwargs):
        '''call function once for each sheet
        '''
        with self._db as con:
            c = con.cursor()
            c.execute('SELECT rowid FROM sheets WHERE survey_rowid=? ORDER BY sort,rowid', (self._survey_rowid,))
            for sheetid, in c.fetchall():
                self.goto_sheet(self._db_get_sheet(sheetid))
                if filter():
                    function(*args, **kwargs)
def iterate ( self , function , filter = lambda : True , * args , * * kwargs ) : with self . _db as con : c = con . cursor ( ) c . execute ( 'SELECT rowid FROM sheets WHERE survey_rowid=? ORDER BY sort,rowid' , ( self . _survey_rowid , ) ) for sheetid , in c . fetchall ( ) : self . goto_sheet ( self . _db_get_sheet ( sheetid ) ) if filter ( ) : function ( * args , * * kwargs )