Skip to content

Commit

Permalink
Fixes #26
Browse files Browse the repository at this point in the history
  • Loading branch information
slominskir committed Dec 9, 2021
1 parent d80e832 commit c466956
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
11 changes: 7 additions & 4 deletions scripts/client/list-classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,16 @@ def classes_disp_table(records):


def classes_export(records):
for msg in records.values():
key = msg.key()
value = msg.value()
sortedtable = sorted(records.items())

for msg in sortedtable:
key = msg[0];
value = msg[1].value()

if params.category is None or (value is not None and params.category == value.category.name):
k = key
v = json.dumps(AlarmClassSerde.to_dict(value))
sortedrow = dict(sorted(AlarmClassSerde.to_dict(value).items()))
v = json.dumps(sortedrow)
print(k + '=' + v)


Expand Down
11 changes: 7 additions & 4 deletions scripts/client/list-registrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,16 @@ def registrations_disp_table(records):


def registrations_export(records):
for msg in records.values():
key = msg.key()
value = msg.value()
sortedtable = sorted(records.items())

for msg in sortedtable:
key = msg[0];
value = msg[1].value()

if params.category is None or (value is not None and params.category == value.category.name):
if params.alarm_class is None or (value is not None and params.alarm_class == value.alarm_class):
v = json.dumps(AlarmRegistrationSerde.to_dict(value, UnionEncoding.DICT_WITH_TYPE))
sortedrow = dict(sorted(AlarmRegistrationSerde.to_dict(value, UnionEncoding.DICT_WITH_TYPE).items()))
v = json.dumps(sortedrow)
print(key + '=' + v)


Expand Down

0 comments on commit c466956

Please sign in to comment.