~savoy/ade

dbcb720847673cd2b4c0adaeaf7d0219312618f9 — savoy 2 years ago cb30882
bug: pivot formatting compatible with None subs

Signed-off-by: savoy <git@liberation.red>
1 files changed, 5 insertions(+), 1 deletions(-)

M ade/lib/formatting.py
M ade/lib/formatting.py => ade/lib/formatting.py +5 -1
@@ 97,7 97,11 @@ def adhoc_pivot(

    # subtotal formatting must loop through cell values to determine if its necessary
    gradient_range = (242, 121)
    number_of_subs = len(pivot_struct.subs)
    try:
        number_of_subs = len(pivot_struct.subs)
    except TypeError:
        number_of_subs = 0
        pivot_struct.subs = []
    gradient_step = {5: 20, 10: 10, 20: 5, 0: 1}
    for steps, percent in gradient_step.items():
        if number_of_subs <= steps or steps == 0: