From 293255ee48a33d2910821ab992d613070e9dacc5 Mon Sep 17 00:00:00 2001 From: Marianpol Date: Wed, 27 Jan 2021 02:07:01 +0100 Subject: [PATCH] Issue #14 fix Search modules with the most specific query first --- pyren/mod_scan_ecus.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyren/mod_scan_ecus.py b/pyren/mod_scan_ecus.py index b30533c..3bbc9da 100644 --- a/pyren/mod_scan_ecus.py +++ b/pyren/mod_scan_ecus.py @@ -163,7 +163,7 @@ class ScanEcus: self.elm.init_can() #print self.allecus - for ecu, row in sorted(self.allecus.iteritems(),key = lambda (x,y) :y['idf']+y['protocol']): + for ecu, row in sorted(self.allecus.iteritems(),key = lambda (x,y) :y['idf']+y['protocol']+str(1/float(len(y['ids'])))): if (self.allecus[ecu]['pin']=='can' and self.allecus[ecu]['pin1']==canH and self.allecus[ecu]['pin2']==canL):