1
# -*- encoding: utf-8 -*-
2
##############################################################################
4
# OpenERP, Open Source Management Solution
6
# Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved.
8
# This program is free software: you can redistribute it and/or modify
9
# it under the terms of the GNU Affero General Public License as
10
# published by the Free Software Foundation, either version 3 of the
11
# License, or (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU Affero General Public License for more details.
18
# You should have received a copy of the GNU Affero General Public License
19
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
##############################################################################
25
return compile(code, '<string>', 'eval')
27
def rowcol_to_cell(row, col, row_abs=False, col_abs=False):
28
# Code based upon utils from xlwt distribution
30
Convert numeric row/col notation to an Excel cell reference string in A1 notation.
34
chr1 = "" # Most significant character in AA1
44
chr1 = chr(ord('A') + d - 1)
45
chr2 = chr(ord('A') + m)
46
# Zero index to 1-index
47
return col_abs + chr1 + chr2 + row_abs + str(row + 1)
49
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: