I also added this function which replaces the earlier packComparisonData()
.
def packTabs(tab_set, test_file):
"""Destructures a list of lines into a collection fo TabEntry objects,
each of which containing a list of one or more subentries, and
inserting the entries into a TabSet."""
tab_titles = list()
for line in test_file:
tab_count, tab_title, button_name, json_request, expected_response = line.split('<->')
tab_title = tab_title.strip()
tab_set.add(tab_title,
button_name=button_name.strip(),
json_request=json_request.strip(),
expected_response=expected_response.strip())
if tab_title not in tab_titles:
tab_titles.append(tab_title)
tab_set.add(tab_title, tab=tk.Frame(tab_set))
ttk.Label(tab_set.tabEntries[tab_title].tab, text=tab_title)
tab_set.pack(expand=1, fill="both")
This would be called like so:
tabControl = TabSet(tabmain1, frmmain)
packTabs(tabControl, varconfbook)