def get_tab(win_id, target):
 if (target == usertypes.ClickTarget.tab):
  win_id = win_id
  bg_tab = False
 elif (target == usertypes.ClickTarget.tab_bg):
  win_id = win_id
  bg_tab = True
 elif (target == usertypes.ClickTarget.window):
  from qutebrowser.mainwindow import mainwindow
  window = mainwindow.MainWindow()
  window.show()
  win_id = window.win_id
  bg_tab = False
 else:
  raise ValueError('Invalid ClickTarget {}'.format(target))
 tabbed_browser = objreg.get('tabbed-browser', scope='window', window=win_id)
 return tabbed_browser.tabopen(url=None, background=bg_tab)

def get_tab ( win_id , target ) : if ( target == usertypes . ClickTarget . tab ) : win_id = win_id bg_tab = False elif ( target == usertypes . ClickTarget . tab_bg ) : win_id = win_id bg_tab = True elif ( target == usertypes . ClickTarget . window ) : from qutebrowser . mainwindow import mainwindow window = mainwindow . MainWindow ( ) window . show ( ) win_id = window . win_id bg_tab = False else : raise ValueError ( 'Invalid ClickTarget {}' . format ( target ) ) tabbed_browser = objreg . get ( 'tabbed-browser' , scope = 'window' , window = win_id ) return tabbed_browser . tabopen ( url = None , background = bg_tab )
get a tab widget for the given usertypes .