From f5356b571bd89445671b3778bd09cd4f554ee91c Mon Sep 17 00:00:00 2001 From: Steven Robertson Date: Fri, 16 Mar 2012 20:37:25 -0700 Subject: [PATCH] Fix handling of optional values in XML import --- cuburn/genome.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cuburn/genome.py b/cuburn/genome.py index 365add9..5839859 100644 --- a/cuburn/genome.py +++ b/cuburn/genome.py @@ -340,7 +340,7 @@ def convert_flame(flame, arc=-360, offset=0): 'center': dict(zip('xy', map(float, flame['center'].split()))), 'scale': float(flame['scale']) / float(flame['size'].split()[0]), 'dither_width': float(flame['filter']), - 'rotation': float(flame['rotate']), + 'rotation': float(flame.get('rotate', 0)), 'density': 1.0 } @@ -358,7 +358,7 @@ def convert_flame(flame, arc=-360, offset=0): color = cvt(['brightness', 'gamma']) color.update((k, float(flame.get(k, d))) for k, d in [('highlight_power', -1), ('gamma_threshold', 0.01)]) - color['vibrance'] = float(flame['vibrancy']) + color['vibrance'] = float(flame.get('vibrancy', 1)) color['background'] = dict(zip('rgb', map(float, flame['background'].split()))) color['palette_times'] = "0"