diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-12-06 12:29:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-06 12:29:29 -0500 |
commit | ea182bbea386288b1acfbc35c99243a457ff1036 (patch) | |
tree | d3641a78217bbb79cbe039f80648b44b2fbdd0a4 /examples/table_display.py | |
parent | 709af49a7f161c98260cc5ddda736987fb0f1f23 (diff) | |
parent | 9d90c1eb57c62ba1fcd8e470fa2e27248e1e9064 (diff) | |
download | cmd2-git-ea182bbea386288b1acfbc35c99243a457ff1036.tar.gz |
Merge pull request #607 from python-cmd2/flake8
Fix flake8 issues
Diffstat (limited to 'examples/table_display.py')
-rwxr-xr-x | examples/table_display.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/table_display.py b/examples/table_display.py index 7541e548..04415afd 100755 --- a/examples/table_display.py +++ b/examples/table_display.py @@ -52,11 +52,11 @@ EXAMPLE_ITERABLE_DATA = [['Shanghai (上海)', 'Shanghai', 'China', 'Asia', 2418 ['Guangzho (广州市)', 'Guangdong', 'China', 'Asia', 13081000, 1347.81], ['Mumbai (मुंबई)', 'Maharashtra', 'India', 'Asia', 12442373, 465.78], ['Istanbul (İstanbuld)', 'Istanbul', 'Turkey', 'Eurasia', 12661000, 620.29], - ] + ] # Calculate population density for row in EXAMPLE_ITERABLE_DATA: - row.append(row[-2]/row[-1]) + row.append(row[-2] / row[-1]) # Column headers plus optional formatting info for each column @@ -69,7 +69,7 @@ COLUMNS = [tf.Column('City', width=11, header_halign=tf.ColumnAlignment.AlignCen cell_halign=tf.ColumnAlignment.AlignRight, formatter=two_dec), tf.Column('Pop. Density (/km²)', width=12, header_halign=tf.ColumnAlignment.AlignCenter, cell_halign=tf.ColumnAlignment.AlignRight, formatter=no_dec), - ] + ] # ######## Table data formatted as an iterable of python objects ######### @@ -119,7 +119,7 @@ OBJ_COLS = [tf.Column('City', attrib='city', header_halign=tf.ColumnAlignment.Al cell_halign=tf.ColumnAlignment.AlignRight, formatter=two_dec), tf.Column('Pop. Density (/km²)', width=12, header_halign=tf.ColumnAlignment.AlignCenter, cell_halign=tf.ColumnAlignment.AlignRight, obj_formatter=pop_density), - ] + ] EXTREMELY_HIGH_POULATION_DENSITY = 25000 |