#NEWLINE# def absolute_coordinate( coord_string ) : #NEWLINE# #INDENT# 'Convert a coordinate to an absolute coordinate string (B12 -> $B$12)' #NEWLINE# parts = ABSOLUTE_RE . match ( coord_string ) . groups ( ) #NEWLINE# if all ( parts [ ( - 2 ) : ] ) : #NEWLINE# #INDENT# return ( '$%s$%s:$%s$%s' % ( parts [ 0 ] , parts [ 1 ] , parts [ 3 ] , parts [ 4 ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( '$%s$%s' % ( parts [ 0 ] , parts [ 1 ] ) )