From 708d9a316464aa8fab9a3c5d3bc6f497c9f5869d Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Fri, 23 Mar 2018 05:34:10 +0000 Subject: [PATCH] slight style-alteration on pinmap.txt parsing --- src/parse.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/parse.py b/src/parse.py index d935877..a11e45d 100644 --- a/src/parse.py +++ b/src/parse.py @@ -37,17 +37,20 @@ class Parse(object): muxed_cells = [] dedicated_cells = [] pinnumbers = [] + for lineno, line in enumerate(pinmapfile): line1 = line.split() - if(len(line1) > 1): - pinnumbers.append(int(line1[0])) - if(len(line1) == 2): # dedicated - dedicated_cells.append(line1) - if(len(line1) > 2): - muxed_cells.append(line1) - pinnumbers = sorted(pinnumbers) + if len(line1) <= 1: + continue + pinnumbers.append(int(line1[0])) + if len(line1) == 2: # dedicated + dedicated_cells.append(line1) + else: + muxed_cells.append(line1) + pinnumbers = sorted(pinnumbers) upper_offset = lower_offset + int(math.log(len(muxed_cells), 2)) + # ============================================= # # ======= Multiple checks to see if the user has not screwed ======# missing_pins = missing_numbers(pinnumbers) -- 2.30.2