#NEWLINE# def __iter__( self ) : #NEWLINE# #INDENT# cursor = self . _cursor ( ) #NEWLINE# cursor . execute ( ( self . sql_select + ' where mainchain = 1 and height >= 0 order by height asc' ) ) #NEWLINE# while True : #NEWLINE# #INDENT# rows = cursor . fetchmany ( ) #NEWLINE# if ( not rows ) : #NEWLINE# #INDENT# raise StopIteration ( ) #NEWLINE# #UNINDENT# for row in rows : #NEWLINE# #INDENT# ( yield Block ( self , rows ) )