Reihenfolge des Iterators der Devices ist nun nach Position im Prozessabbild

sortiert und nicht nach Position - Entspricht piCtory
This commit is contained in:
2018-06-27 12:12:31 +02:00
parent 69a7020aac
commit 8e0d1b7455
5 changed files with 14 additions and 5 deletions

View File

@@ -72,8 +72,14 @@ class DeviceList(object):
def __iter__(self):
"""Gibt Iterator aller Devices zurueck.
Die Reihenfolge ist nach Position im Prozessabbild sortiert und nicht
nach Position (Dies entspricht der Positionierung aus piCtory)!
@return <class 'iter'> aller Devices"""
for dev in sorted(self.__dict_position):
for dev in sorted(
self.__dict_position,
key=lambda key: self.__dict_position[key]._offset):
yield self.__dict_position[dev]
def __len__(self):