def subscribe_to_messages(observer_function):
 all_output_plugins = om.manager.get_output_plugin_inst()
 for plugin_inst in all_output_plugins:
  if isinstance(plugin_inst, GtkOutput):
   plugin_inst.subscribe(observer_function)
   break
 else:
  gtk_output = GtkOutput()
  om.manager.set_output_plugin_inst(gtk_output)
  gtk_output.subscribe(observer_function)

def subscribe_to_messages ( observer_function ) : all_output_plugins = om . manager . get_output_plugin_inst ( ) for plugin_inst in all_output_plugins : if isinstance ( plugin_inst , GtkOutput ) : plugin_inst . subscribe ( observer_function ) break else : gtk_output = GtkOutput ( ) om . manager . set_output_plugin_inst ( gtk_output ) gtk_output . subscribe ( observer_function )
subscribe observer_function to the gtkoutput messages .