Improve RadioID file handling
This commit is contained in:
parent
66a082dbb8
commit
6fe0cd1a61
@ -102,6 +102,8 @@ def mk_id_dict(_path, _file):
|
|||||||
try:
|
try:
|
||||||
with open(_path+_file, 'rU') as _handle:
|
with open(_path+_file, 'rU') as _handle:
|
||||||
records = jload(_handle)
|
records = jload(_handle)
|
||||||
|
if 'count' in records:
|
||||||
|
del records['count']
|
||||||
records = records[records.keys()[0]]
|
records = records[records.keys()[0]]
|
||||||
_handle.close
|
_handle.close
|
||||||
for record in records:
|
for record in records:
|
||||||
@ -120,6 +122,8 @@ def mk_full_id_dict(_path, _file, _type):
|
|||||||
try:
|
try:
|
||||||
with open(_path+_file, 'rU') as _handle:
|
with open(_path+_file, 'rU') as _handle:
|
||||||
records = jload(_handle)
|
records = jload(_handle)
|
||||||
|
if 'count' in records:
|
||||||
|
del records['count']
|
||||||
records = records[records.keys()[0]]
|
records = records[records.keys()[0]]
|
||||||
_handle.close
|
_handle.close
|
||||||
if _type == 'peer':
|
if _type == 'peer':
|
||||||
|
Loading…
Reference in New Issue
Block a user