Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
This commit is contained in:
Tim 'mithro' Ansell 2018-12-27 12:02:33 +01:00
parent 79b99b39f8
commit 1b48dfd1aa
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ def extract_numbers(s):
def sort(data):
# FIXME: We assume that a list is a tileconn.json format...
if isinstance(data, list):
if isinstance(data, list) and len(data) > 0 and 'wire_pairs' in data[0]:
for o in data:
o['wire_pairs'].sort(
key=lambda o: (extract_numbers(o[0]), extract_numbers(o[1])))