#NEWLINE# def append( self , iterable ) : #NEWLINE# #INDENT# "Appends a group of values at the bottom of the current sheet.\n\n        * If it's a list: all values are added in order, starting from the first column\n        * If it's a dict: values are assigned to the columns indicated by the keys (numbers or letters)\n\n        :param iterable: list, range or generator, or dict containing values to append\n        :type iterable: list/tuple/range/generator or dict\n\n        Usage:\n\n        * append(['This is A1', 'This is B1', 'This is C1'])\n        * **or** append({'A' : 'This is A1', 'C' : 'This is C1'})\n        * **or** append({1 : 'This is A1', 3 : 'This is C1'})\n\n        :raise: TypeError when iterable is neither a list/tuple nor a dict\n\n        " #NEWLINE# row_idx = ( self . _current_row + 1 ) #NEWLINE# if ( isinstance ( iterable , ( list , tuple , range ) ) or isgenerator ( iterable ) ) : #NEWLINE# #INDENT# for ( col_idx , content ) in enumerate ( iterable , 1 ) : #NEWLINE# #INDENT# if isinstance ( content , Cell ) : #NEWLINE# #INDENT# cell = content #NEWLINE# cell . parent = self #NEWLINE# cell . col_idx = col_idx #NEWLINE# cell . row = row_idx #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cell = Cell ( self , row = row_idx , col_idx = col_idx , value = content ) #NEWLINE# #UNINDENT# self . _cells [ ( row_idx , col_idx ) ] = cell #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( content , dict ) : #NEWLINE# #INDENT# for ( col_idx , content ) in iteritems ( iterable ) : #NEWLINE# #INDENT# if isinstance ( col_idx , basestring ) : #NEWLINE# #INDENT# col_idx = column_index_from_string ( col_idx ) #NEWLINE# #UNINDENT# cell = Cell ( self , row = row_idx , col_idx = col_idx , value = content ) #NEWLINE# self . _cells [ ( row_idx , col_idx ) ] = cell #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . _invalid_row ( iterable ) #NEWLINE# #UNINDENT# #UNINDENT# self . _current_row = row_idx