From faee91876f5c5fab24dacb132e8d9646a0fecc0c Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Fri, 9 Aug 2013 17:30:00 -0400 Subject: [PATCH] MAINT: Add formatting for printing of answer key DataIndex. Output format of the range compatible with Excel, so that it can be copy and pasted back into the spread sheet for easier corroboration. --- tests/risk/answer_key.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/risk/answer_key.py b/tests/risk/answer_key.py index 0ba08af0..6de07485 100644 --- a/tests/risk/answer_key.py +++ b/tests/risk/answer_key.py @@ -133,6 +133,14 @@ class DataIndex(object): def row_end_index(self): return self.row_end - 1 + def __str__(self): + return "'{sheet_name}'!{col}{row_start}:{col}{row_end}".format( + sheet_name=self.sheet_name, + col=self.col, + row_start=self.row_start, + row_end=self.row_end + ) + class AnswerKey(object):