示例#1
0
	def getGrids(self) :
		self.__grids = []
		nbRows_l = self.__worksheet.nrows - 1
		nbCols_l = self.__worksheet.ncols - 1
		currRow_l = -1 # start at first line
		while currRow_l < nbRows_l:
			grid_l = Grid()
			currRow_l += 1
			row_l = self.__worksheet.row(currRow_l)
#print 'Row:', currRow_l
			if self.__worksheet.cell_type(currRow_l, 0) != 0 : # not emty cell
				currCol_l = -1 # first col
				while currCol_l < nbCols_l:
					currCol_l += 1
					# Cell Types: 0=Empty, 1=Text, 2=Number, 3=Date, 4=Boolean, 5=Error, 6=Blank
					cellType_l = self.__worksheet.cell_type(currRow_l, currCol_l)
					cellValue_l = self.__worksheet.cell_value(currRow_l, currCol_l)
#print '	', cellType_l, ':', cellValue_l
					if currCol_l == 0 :
						grid_l.setBet(cellValue_l)
					else :
						grid_l.setNextCell(cellValue_l, cellType_l)

				self.__grids.append(copy.deepcopy(grid_l))

			else :
				nbRows_l = currRow_l
		
		return self.__grids