Return the result value of a cell, line split if too much data

def GetValue(self, row, col, table=None):
        """Return the result value of a cell, line split if too much data"""

        if table is None:
            table = self.grid.current_table

        try:
            cell_code = self.code_array((row, col, table))
        except IndexError:
            cell_code = None

        # Put EOLs into result if it is too long
        maxlength = int(config["max_textctrl_length"])

        if cell_code is not None and len(cell_code) > maxlength:
            chunk = 80
            cell_code = "\n".join(cell_code[i:i + chunk]
                                  for i in xrange(0, len(cell_code), chunk))

        return cell_code