def html_menu_lhs(): # html = '' # t = 0 # a_list = get_cfg_idlist_accounts() a_num = 0 # while a_num < len(a_list): # html += '<span class="sidebar_divider box-shadow"></span>' # label = get_cfg_account_name(a_list[a_num]) img = get_device_logo(get_cfg_account_type(a_list[a_num])) # html += urlopen('web/html/html_menu/menu_sidebar_item.html').read().encode('utf-8').format(href=('/web/account/{account_id}').format(account_id=a_list[a_num]), id='{account_id}'.format(account_id=a_list[a_num]), cls='', name=label, img=img) # t += 1 a_num += 1 # r_list = get_cfg_idlist_rooms() r_num = 0 # while r_num < len(r_list): d_list = get_cfg_idlist_devices(r_list[r_num]) d_num = 0 # html += '<span class="sidebar_divider box-shadow"></span>' # html += urlopen('web/html/html_menu/menu_sidebar_title.html').read().encode('utf-8').\ format(name=get_cfg_room_name(r_list[r_num])) # while d_num < len(d_list): # label = get_cfg_device_name(r_list[r_num], d_list[d_num]) img = get_device_logo(get_cfg_device_type(r_list[r_num], d_list[d_num])) # html += urlopen('web/html/html_menu/menu_sidebar_item.html').read().encode('utf-8').format(href=('/web/device/{room_id}/{device_id}').format(room_id=r_list[r_num], device_id=d_list[d_num]), id='{room_id}_{device_id}'.format(room_id=r_list[r_num], device_id=d_list[d_num]), cls='', name=label, img=img) d_num += 1 # r_num += 1 # return urlopen('web/html/html_menu/menu_lhs.html').read().encode('utf-8').format(menu=html)
def create_device_threads(q_devices, q_accounts, queues): # t = 0 thread = [] # r_list = get_cfg_idlist_rooms() r_num = 0 # while r_num < len(r_list): d_list = get_cfg_idlist_devices(r_list[r_num]) d_num = 0 # while d_num < len(d_list): # thread.append(threading.Thread(target=_create_device, args=(r_list[r_num], d_list[d_num], q_devices[r_num][d_num], queues))) thread[t].daemon = True thread[t].start() # print_msg('Thread created: {type}'.format(type=get_cfg_device_type(r_list[r_num], d_list[d_num])), dvc_or_acc_id=r_list[r_num]+':'+d_list[d_num]) # t += 1 d_num += 1 r_num += 1 # # a_list = get_cfg_idlist_accounts() a_num = 0 # while a_num < len(a_list): # thread.append(threading.Thread(target=_create_account, args=(a_list[a_num], q_accounts[a_num], queues))) thread[t].daemon = True thread[t].start() # print_msg('Thread created: {type}'.format(type=get_cfg_account_type(a_list[a_num])), dvc_or_acc_id=a_list[a_num]) # t += 1 a_num += 1 # x = 0 while x < t: thread[x].join()
# d_list = get_cfg_idlist_devices(r_list[r_num]) d_num = 0 # device_queues.append([]) device_queues[r_num] = [] # while d_num < len(d_list): # device_queues[r_num].append([]) device_queues[r_num][d_num] = Manager().Queue() # d_num += 1 r_num += 1 # a_list = get_cfg_idlist_accounts() a_num = 0 # # while a_num < len(a_list): # account_queues.append([]) account_queues[a_num] = Manager().Queue() # a_num += 1 ################################ # Queues for responses back to port_listener ################################ q_response_data = Manager().Queue() q_response_comand = Manager().Queue()