# HG changeset patch # User Ludovic Chabant # Date 1483673841 28800 # Node ID 9d08d3bcb4ce439451c0e4b0b9e05de602c04041 # Parent cd284808d139d09723488339f8fc3ba88306a222 Fix some crashes with the console renderer. diff -r cd284808d139 -r 9d08d3bcb4ce jouvence/console.py --- a/jouvence/console.py Thu Jan 05 09:27:41 2017 -0800 +++ b/jouvence/console.py Thu Jan 05 19:37:21 2017 -0800 @@ -21,24 +21,23 @@ colorama.init() def write_title_page(self, values, out): - known = ['title', 'credit', 'author', 'source'] - center_values = [values.get(i) for i in known - if i is not None] + known = ['title', 'credit', 'author', 'authors', 'source'] + center_values = [values.get(i) for i in known] print("", file=out) for val in center_values: - for l in val.split('\n'): - print(l.center(self.width), file=out) + if val is not None: + for l in val.split('\n'): + print(l.center(self.width), file=out) print("", file=out) print("", file=out) print("", file=out) - ddate = values.get('date') or values.get('draft date') - contact = values.get('contact') - bottom_lines = [i for i in [ddate, contact] - if i is not None] + known = ['date', 'draft date', 'contact', 'copyright'] + bottom_lines = [values.get(i) for i in known] - _w(out, colorama.Style.DIM, '\n\n'.join(bottom_lines)) + _w(out, colorama.Style.DIM, '\n\n'.join([ + b for b in bottom_lines if b is not None])) print("", file=out) _w(out, colorama.Style.DIM, 80 * '=')