Rollback change to mk_id_dict

This commit is contained in:
Cort Buffington 2017-05-18 20:33:43 -05:00
parent 177aca7225
commit 03bdaaae6b
2 changed files with 14 additions and 1 deletions

View File

@ -95,6 +95,19 @@ def mk_id_dict(_path, _file):
with open(_path+_file, 'rU') as _handle: with open(_path+_file, 'rU') as _handle:
ids = csv_reader(_handle, dialect='excel', delimiter=',') ids = csv_reader(_handle, dialect='excel', delimiter=',')
for row in ids: for row in ids:
dict[int(row[0])] = (row[1])
_handle.close
return dict
except IOError:
return dict
def mk_full_id_dict(_path, _file):
dict = {}
try:
with open(_path+_file, 'rU') as _handle:
ids = csv_reader(_handle, dialect='excel', delimiter=',')
for row in ids:
print(repr(row[0]), repr(row[1]), row[3], row[4])
dict[int(row[0])] = {'CALLSIGN': (row[1]), 'NAME': (row[2]), 'CITY': (row[3]), 'STATE': (row[4]), 'COUNTRY':(row[5])} dict[int(row[0])] = {'CALLSIGN': (row[1]), 'NAME': (row[2]), 'CITY': (row[3]), 'STATE': (row[4]), 'COUNTRY':(row[5])}
_handle.close _handle.close
return dict return dict

View File

@ -7,7 +7,7 @@ def readme():
return file.read() return file.read()
setup(name='dmr_utils', setup(name='dmr_utils',
version='0.1.3', version='0.1.4',
description='ETSI DMR (Digital Mobile Radio) Teir II Utilities', description='ETSI DMR (Digital Mobile Radio) Teir II Utilities',
long_description='Modules to disassemble and assemble DMR packets, including generating and decoding varoius FEC routines', long_description='Modules to disassemble and assemble DMR packets, including generating and decoding varoius FEC routines',
classifiers=[ classifiers=[