error fixes

This commit is contained in:
Cort Buffington 2016-11-25 08:39:14 -06:00
parent 03e2dff984
commit 174ad1b743
2 changed files with 15 additions and 4 deletions

View File

@ -107,7 +107,9 @@ def get_info(_id, _dict):
return _dict[_id]
return _id
# These are the functions you should use to look up IDs in the dictionaries
# These are the functions you should use to look up IDs in the dictionaries
# But they don't work here because they reference dictionraries not avaialbe
# in this scope
def sub_alias(_sub_id):
return get_info(int_id(_sub_id), subscriber_ids)

View File

@ -33,7 +33,7 @@ from twisted.internet import task
# Things we import from the main hblink module
from hblink import HBSYSTEM, systems, int_id, hblink_handler
from dmr_utils import hex_str_3, int_id, sub_alias, peer_alias, tg_alias
from dmr_utils import hex_str_3, int_id, get_info
import dec_dmr
import bptc
import hb_config
@ -462,12 +462,21 @@ if __name__ == '__main__':
subscriber_ids = mk_id_dict(CONFIG['ALIASES']['PATH'], CONFIG['ALIASES']['SUBSCRIBER_FILE'])
if subscriber_ids:
logger.info('ID ALIAS MAPPER: peer_ids dictionary is available')
logger.info('ID ALIAS MAPPER: subscriber_ids dictionary is available')
talkgroup_ids = mk_id_dict(CONFIG['ALIASES']['PATH'], CONFIG['ALIASES']['TGID_FILE'])
if talkgroup_ids:
logger.info('ID ALIAS MAPPER: peer_ids dictionary is available')
logger.info('ID ALIAS MAPPER: talkgroup_ids dictionary is available')
# These are the functions you should use to look up IDs in the dictionaries
def sub_alias(_sub_id):
return get_info(int_id(_sub_id), subscriber_ids)
def peer_alias(_peer_id):
return get_info(int_id(_peer_id), peer_ids)
def tg_alias(_tgid):
return get_info(int_id(_tgid), talkgroup_ids)
#
# START HB_ROUTER