From 6fe0cd1a61058cd507566524e5eeeb41611a7b45 Mon Sep 17 00:00:00 2001 From: Cort Buffington Date: Wed, 8 May 2019 13:56:58 -0500 Subject: [PATCH] Improve RadioID file handling --- dmr_utils/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dmr_utils/utils.py b/dmr_utils/utils.py index 7152279..034cf8d 100755 --- a/dmr_utils/utils.py +++ b/dmr_utils/utils.py @@ -102,6 +102,8 @@ def mk_id_dict(_path, _file): try: with open(_path+_file, 'rU') as _handle: records = jload(_handle) + if 'count' in records: + del records['count'] records = records[records.keys()[0]] _handle.close for record in records: @@ -120,6 +122,8 @@ def mk_full_id_dict(_path, _file, _type): try: with open(_path+_file, 'rU') as _handle: records = jload(_handle) + if 'count' in records: + del records['count'] records = records[records.keys()[0]] _handle.close if _type == 'peer':