mbuesch / pyprofibus

PROFIBUS-DP stack

Home Page:https://bues.ch/a/profibus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Modules are sorted lexicographically, not numerically

KaneTW opened this issue · comments

Modules are sorted lexicographically, not numerically:

mods.sort(key = lambda o: self.__reMod.match(o).group(1))

This is counterintuitive, as

a) the regex forces a \d
b) the examples have a number

As a result, module_2 comes after module_10, breaking the configuration.

Good catch. Thanks.
It was supposed to sort numerically, but I forgot the conversion from str to int.
I will fix that in the next version.