def option_close(args): total = ff.get_number_of_tabs() li = [int(x) for x in args['ID'] if 0 <= int(x) < total] for pos, val in enumerate(li): # once a tab is closed, subsequent tabs are shifted one position to the left ff.put_focus_on_tab(val - pos) print '# closing {url} ({title})'.format(url=ff.get_curr_tab_url(), title=ff.get_curr_tab_title()) ff.close_curr_tab()
def option_close(args): total = ff.get_number_of_tabs() li = sorted([int(x) for x in args['ID'] if 0 <= int(x) < total]) for pos, val in enumerate(li): # once a tab is closed, subsequent tabs are shifted one position to the left ff.put_focus_on_tab(val - pos) print '# closing {url} ({title})'.format(url=ff.get_curr_tab_url(), title=ff.get_curr_tab_title()) ff.close_curr_tab()
def option_focus(args): n = int(args['ID'][0]) ff.put_focus_on_tab(n)