def convert_range_args(method):
 def cell_wrapper(self, *args, **kwargs):
  try:
   if len(args):
    int(args[0])
  except ValueError:
   if (':' in args[0]):
    (cell_1, cell_2) = args[0].split(':')
    (row_1, col_1) = xl_cell_to_rowcol(cell_1)
    (row_2, col_2) = xl_cell_to_rowcol(cell_2)
   else:
    (row_1, col_1) = xl_cell_to_rowcol(args[0])
    (row_2, col_2) = (row_1, col_1)
   new_args = [row_1, col_1, row_2, col_2]
   new_args.extend(args[1:])
   args = new_args
  return method(self, *args, **kwargs)
 return cell_wrapper

def convert_range_args ( method ) : def cell_wrapper ( self , * args , ** kwargs ) : try : if len ( args ) : int ( args [ 0 ] ) except ValueError : if ( ':' in args [ 0 ] ) : ( cell_1 , cell_2 ) = args [ 0 ] . split ( ':' ) ( row_1 , col_1 ) = xl_cell_to_rowcol ( cell_1 ) ( row_2 , col_2 ) = xl_cell_to_rowcol ( cell_2 ) else : ( row_1 , col_1 ) = xl_cell_to_rowcol ( args [ 0 ] ) ( row_2 , col_2 ) = ( row_1 , col_1 ) new_args = [ row_1 , col_1 , row_2 , col_2 ] new_args . extend ( args [ 1 : ] ) args = new_args return method ( self , * args , ** kwargs ) return cell_wrapper
decorator function to convert a1 notation in range method calls to the default row/col notation .