def show_help(self): """ Display browser based help about Mu. """ logger.info('Showing help.') current_locale, encoding = locale.getdefaultlocale() language_code = current_locale[:2] major_version = '.'.join(__version__.split('.')[:2]) url = 'https://codewith.mu/{}/help/{}'.format(language_code, major_version) webbrowser.open_new(url)
def test_show_help(): """ Help should attempt to open up the user's browser and point it to the expected help documentation. """ view = mock.MagicMock() ed = mu.logic.Editor(view) with mock.patch('mu.logic.webbrowser.open_new', return_value=None) as wb, \ mock.patch('mu.logic.locale.getdefaultlocale', return_value=('en_GB', 'UTF-8')): ed.show_help() version = '.'.join(__version__.split('.')[:2]) url = 'https://codewith.mu/en/help/{}'.format(version) wb.assert_called_once_with(url)
# The master toctree document. master_doc = 'index' # General information about the project. project = 'Mu' copyright = '2017, Nicholas H.Tollervey' author = 'Nicholas H.Tollervey' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # from mu import __version__ as full_version # The short X.Y version. version = '.'.join(full_version.split('.')[:3]) # The full version, including alpha/beta/rc tags. release = full_version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
master_doc = "index" # General information about the project. project = "Mu" copyright = "2017-2021, Nicholas H.Tollervey and Mu Contributors" author = "Nicholas H.Tollervey" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # from mu import __version__ as full_version # The short X.Y version. version = ".".join(full_version.split(".")[:2]) # The full version, including alpha/beta/rc tags. release = full_version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
# The master toctree document. master_doc = 'index' # General information about the project. project = 'Mu' copyright = '2017-2018, Nicholas H.Tollervey' author = 'Nicholas H.Tollervey' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # from mu import __version__ as full_version # The short X.Y version. version = '.'.join(full_version.split('.')[:3]) # The full version, including alpha/beta/rc tags. release = full_version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']