From 1fded01197f58604fa5f0fc43488a3da2eabc7ab Mon Sep 17 00:00:00 2001 From: George Leslie-Waksman Date: Tue, 15 Mar 2016 19:54:42 -0700 Subject: [PATCH] Compact sheet totals row code. --- mtg_ssm/serialization/xlsx.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/mtg_ssm/serialization/xlsx.py b/mtg_ssm/serialization/xlsx.py index 30ff864..dd23222 100644 --- a/mtg_ssm/serialization/xlsx.py +++ b/mtg_ssm/serialization/xlsx.py @@ -21,17 +21,11 @@ 'count', ] -ALL_SETS_SHEET_TOTALS = [ - 'Total', - None, - None, - None, - None, - '=SUM(F3:F65535)', - '=SUM(G3:G65535)', - '=SUM(H3:H65535)', - '=SUM(I3:I65535)', -] +ALL_SETS_SHEET_TOTALS = ( + ['Total'] + + [None] * 4 + + ['=SUM({c}3:{c}65535)'.format(c=c) for c in 'FGHI'] +) def create_all_sets(sheet, collection):