Merge pull request #409 from mithro/master

Fixes #403.
This commit is contained in:
John Mcmaster 2018-12-27 03:22:53 -08:00 committed by GitHub
commit 5fe439765d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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])))