def choose_plugin(prepared, question):
 opts = [(plugin_ep.description_with_name + (' [Misconfigured]' if plugin_ep.misconfigured else '')) for plugin_ep in prepared]
 while True:
  disp = z_util(interfaces.IDisplay)
  (code, index) = disp.menu(question, opts, help_label='More Info', force_interactive=True)
  if (code == display_util.OK):
   plugin_ep = prepared[index]
   if plugin_ep.misconfigured:
    z_util(interfaces.IDisplay).notification('The selected plugin encountered an error while parsing your server configuration and cannot be used. The error was:\n\n{0}'.format(plugin_ep.prepare()), pause=False)
   else:
    return plugin_ep
  elif (code == display_util.HELP):
   if prepared[index].misconfigured:
    msg = ('Reported Error: %s' % prepared[index].prepare())
   else:
    msg = prepared[index].init().more_info()
   z_util(interfaces.IDisplay).notification(msg, force_interactive=True)
  else:
   return None

def choose_plugin ( prepared , question ) : opts = [ ( plugin_ep . description_with_name + ( ' [Misconfigured]' if plugin_ep . misconfigured else '' ) ) for plugin_ep in prepared ] while True : disp = z_util ( interfaces . IDisplay ) ( code , index ) = disp . menu ( question , opts , help_label = 'More Info' , force_interactive = True ) if ( code == display_util . OK ) : plugin_ep = prepared [ index ] if plugin_ep . misconfigured : z_util ( interfaces . IDisplay ) . notification ( 'The selected plugin encountered an error while parsing your server configuration and cannot be used. The error was:\n\n{0}' . format ( plugin_ep . prepare ( ) ) , pause = False ) else : return plugin_ep elif ( code == display_util . HELP ) : if prepared [ index ] . misconfigured : msg = ( 'Reported Error: %s' % prepared [ index ] . prepare ( ) ) else : msg = prepared [ index ] . init ( ) . more_info ( ) z_util ( interfaces . IDisplay ) . notification ( msg , force_interactive = True ) else : return None
allow the user to choose their plugin .