From 205c8aa2b70d22ed0d5aef844dc349773ff6bf04 Mon Sep 17 00:00:00 2001 From: Eric Jeschke Date: Wed, 7 Feb 2024 13:26:35 -1000 Subject: [PATCH] Change to open help in external browser if using ginga ver < 5 --- stginga/plugins/local_plugin_mixin.py | 30 +++------------------------ 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/stginga/plugins/local_plugin_mixin.py b/stginga/plugins/local_plugin_mixin.py index 4aa9369..b3aaaad 100644 --- a/stginga/plugins/local_plugin_mixin.py +++ b/stginga/plugins/local_plugin_mixin.py @@ -24,36 +24,12 @@ class HelpMixin(object): - def _stginga_help_docstring(self): - import inspect - - # Insert section title at the beginning - plg_name = self.__class__.__name__ - plg_mod = inspect.getmodule(self) - plg_doc = ('{}\n{}\n'.format(plg_name, '=' * len(plg_name)) + - plg_mod.__doc__) - - self.fv.show_help_text(plg_name, plg_doc, wsname='channels') - def help(self): """Display online help for the plugin.""" - if self.fv.gpmon.has_plugin('WBrowser') and Widgets.has_webkit: - # ginga < v5.x - self.fv.start_global_plugin('WBrowser') - - # need to let GUI finish processing, it seems - self.fv.update_pending() - - obj = self.fv.gpmon.get_plugin('WBrowser') - - # Unlike Ginga, we do not attempt to download offline doc - # but just point to online doc directly. - obj.browse(self.help_url) - return - if not hasattr(self.fv, 'help_plugin'): - # ginga < v5.x but somehow user doesn't have WBrowser plugin - self._stginga_help_docstring() + # ginga < v5.x, open in external browser + import webbrowser + webbrowser.open(self.help_url) return # ginga v5.x