From 8dbce114bdfbc90cd0ae54956041105a1e8418f8 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 23 Mar 2023 15:36:33 +0000 Subject: [PATCH] Manually fix up overlong docstrings --- .../tasks/attractors/model/i_model_3d.py | 4 +- envisage/plugins/tasks/python_shell_plugin.py | 4 +- .../tests/test_composite_plugin_manager.py | 4 +- .../tests/test_egg_basket_plugin_manager.py | 4 +- envisage/tests/test_egg_plugin_manager.py | 4 +- .../tests/test_extension_point_changed.py | 4 +- envisage/tests/test_package_plugin_manager.py | 4 +- envisage/tests/test_plugin_manager.py | 4 +- .../tests/test_provider_extension_registry.py | 44 ++++++++++++++----- .../tasks/action/task_window_toggle_group.py | 4 +- envisage/ui/tasks/preferences_dialog.py | 8 +++- envisage/ui/tasks/preferences_pane.py | 4 +- .../workbench_action_manager_builder.py | 4 +- 13 files changed, 72 insertions(+), 24 deletions(-) diff --git a/envisage/examples/demo/plugins/tasks/attractors/model/i_model_3d.py b/envisage/examples/demo/plugins/tasks/attractors/model/i_model_3d.py index 1225d613c..027afd54e 100644 --- a/envisage/examples/demo/plugins/tasks/attractors/model/i_model_3d.py +++ b/envisage/examples/demo/plugins/tasks/attractors/model/i_model_3d.py @@ -34,7 +34,9 @@ class IModel3d(Interface): class IModel3dIPlottable2dMixin(HasTraits): - """Mixin class to facilitate defining a IModel3d -> IPlottable2D adapter.""" + """ + Mixin class to facilitate defining a IModel3d -> IPlottable2D adapter. + """ #### 'Adapter' interface ################################################## diff --git a/envisage/plugins/tasks/python_shell_plugin.py b/envisage/plugins/tasks/python_shell_plugin.py index f8c144416..ff611f034 100644 --- a/envisage/plugins/tasks/python_shell_plugin.py +++ b/envisage/plugins/tasks/python_shell_plugin.py @@ -117,7 +117,9 @@ def start(self): logger.debug("started python shell plugin") def _contributed_bindings_default(self): - """By default, expose the Envisage application object to the namespace""" + """ + By default, expose the Envisage application object to the namespace + """ return [{"application": self.application}] def _tasks_default(self): diff --git a/envisage/tests/test_composite_plugin_manager.py b/envisage/tests/test_composite_plugin_manager.py index 7085be417..7e103bc48 100644 --- a/envisage/tests/test_composite_plugin_manager.py +++ b/envisage/tests/test_composite_plugin_manager.py @@ -168,7 +168,9 @@ def _plugin_count(self, plugin_manager): return count def _test_start_and_stop(self, plugin_manager, expected): - """Make sure the plugin manager starts and stops the expected plugins.""" + """ + Make sure the plugin manager starts and stops the expected plugins. + """ # Make sure the plugin manager found only the required plugins. self.assertEqual(expected, [plugin.id for plugin in plugin_manager]) diff --git a/envisage/tests/test_egg_basket_plugin_manager.py b/envisage/tests/test_egg_basket_plugin_manager.py index c7c788ddb..1dfabaf1c 100644 --- a/envisage/tests/test_egg_basket_plugin_manager.py +++ b/envisage/tests/test_egg_basket_plugin_manager.py @@ -262,7 +262,9 @@ def on_broken_distribution(dist, exc): #### Private protocol ##################################################### def _test_start_and_stop(self, plugin_manager, expected): - """Make sure the plugin manager starts and stops the expected plugins.""" + """ + Make sure the plugin manager starts and stops the expected plugins. + """ # Make sure the plugin manager found only the required plugins. self.assertEqual(expected, [plugin.id for plugin in plugin_manager]) diff --git a/envisage/tests/test_egg_plugin_manager.py b/envisage/tests/test_egg_plugin_manager.py index 8219a60fe..91ab73bb6 100644 --- a/envisage/tests/test_egg_plugin_manager.py +++ b/envisage/tests/test_egg_plugin_manager.py @@ -162,7 +162,9 @@ def test_uses_global_working_set_by_default(self): ########################################################################### def _test_start_and_stop(self, plugin_manager, expected): - """Make sure the plugin manager starts and stops the expected plugins.""" + """ + Make sure the plugin manager starts and stops the expected plugins. + """ # Make sure the plugin manager found only the required plugins. self.assertEqual(expected, [plugin.id for plugin in plugin_manager]) diff --git a/envisage/tests/test_extension_point_changed.py b/envisage/tests/test_extension_point_changed.py index 66503e0ba..c5ed24b4f 100644 --- a/envisage/tests/test_extension_point_changed.py +++ b/envisage/tests/test_extension_point_changed.py @@ -389,7 +389,9 @@ def test_remove_plugin(self): self.assertEqual(0, event.new.index) def test_extension_point_change_event_str_representation(self): - """test string representation of the ExtensionPointChangedEvent class""" + """ + test string representation of the ExtensionPointChangedEvent class + """ desired_repr = ( "ExtensionPointChangedEvent(extension_point_id={}, " "index=0, removed=[], added=[])" diff --git a/envisage/tests/test_package_plugin_manager.py b/envisage/tests/test_package_plugin_manager.py index 9556c1042..5b1d8ad39 100644 --- a/envisage/tests/test_package_plugin_manager.py +++ b/envisage/tests/test_package_plugin_manager.py @@ -125,7 +125,9 @@ def test_reflect_changes_to_the_plugin_path(self): #### Private protocol ##################################################### def _test_start_and_stop(self, plugin_manager, expected): - """Make sure the plugin manager starts and stops the expected plugins.""" + """ + Make sure the plugin manager starts and stops the expected plugins. + """ # Make sure the plugin manager found only the required plugins. self.assertEqual( diff --git a/envisage/tests/test_plugin_manager.py b/envisage/tests/test_plugin_manager.py index b17f293dc..cc0cb1e1b 100644 --- a/envisage/tests/test_plugin_manager.py +++ b/envisage/tests/test_plugin_manager.py @@ -231,7 +231,9 @@ def test_ignore_plugins_matching_a_wildcard_in_the_exclude_list(self): #### Private protocol ##################################################### def _test_start_and_stop(self, plugin_manager, expected): - """Make sure the plugin manager starts and stops the expected plugins.""" + """ + Make sure the plugin manager starts and stops the expected plugins. + """ # Make sure the plugin manager found only the required plugins. self.assertEqual(expected, [plugin.id for plugin in plugin_manager]) diff --git a/envisage/tests/test_provider_extension_registry.py b/envisage/tests/test_provider_extension_registry.py index d9ccf04b5..69c32221a 100644 --- a/envisage/tests/test_provider_extension_registry.py +++ b/envisage/tests/test_provider_extension_registry.py @@ -52,7 +52,9 @@ def get_extension_points(self): return [ExtensionPoint(List, "x")] def get_extensions(self, extension_point): - """Return the provider's contributions to an extension point.""" + """ + Return the provider's contributions to an extension point. + """ if extension_point == "x": extensions = [42, 43] @@ -66,7 +68,9 @@ class ProviderB(ExtensionProvider): """An extension provider.""" def get_extensions(self, extension_point): - """Return the provider's contributions to an extension point.""" + """ + Return the provider's contributions to an extension point. + """ if extension_point == "x": extensions = [44, 45, 46] @@ -111,7 +115,9 @@ def get_extension_points(self): return [ExtensionPoint(List, "my.ep")] def get_extensions(self, extension_point_id): - """Return the provider's contributions to an extension point.""" + """ + Return the provider's contributions to an extension point. + """ if extension_point_id == "my.ep": return self.x @@ -141,7 +147,9 @@ class ProviderB(ExtensionProvider): x = List(Int) def get_extensions(self, extension_point_id): - """Return the provider's contributions to an extension point.""" + """ + Return the provider's contributions to an extension point. + """ if extension_point_id == "my.ep": return self.x @@ -246,7 +254,9 @@ def get_extension_points(self): return [ExtensionPoint(List, "x")] def get_extensions(self, extension_point): - """Return the provider's contributions to an extension point.""" + """ + Return the provider's contributions to an extension point. + """ if extension_point == "x": return [42] @@ -288,7 +298,9 @@ class ProviderB(ExtensionProvider): """An extension provider.""" def get_extensions(self, extension_point): - """Return the provider's contributions to an extension point.""" + """ + Return the provider's contributions to an extension point. + """ if extension_point == "x": extensions = [43, 44] @@ -349,7 +361,9 @@ def get_extension_points(self): return [ExtensionPoint(List, "x"), ExtensionPoint(List, "y")] def get_extensions(self, extension_point): - """Return the provider's contributions to an extension point.""" + """ + Return the provider's contributions to an extension point. + """ if extension_point == "x": return [42] @@ -370,7 +384,9 @@ class ProviderB(ExtensionProvider): """An extension provider.""" def get_extensions(self, extension_point): - """Return the provider's contributions to an extension point.""" + """ + Return the provider's contributions to an extension point. + """ if extension_point == "x": extensions = [43, 44] @@ -447,7 +463,9 @@ def get_extension_points(self): return [ExtensionPoint(List, "x"), ExtensionPoint(List, "y")] def get_extensions(self, extension_point): - """Return the provider's contributions to an extension point.""" + """ + Return the provider's contributions to an extension point. + """ return [] @@ -523,12 +541,16 @@ class ProviderA(ExtensionProvider): """An extension provider.""" def get_extension_points(self): - """Return the extension points offered by the provider.""" + """ + Return the extension points offered by the provider. + """ return [ExtensionPoint(List, "x")] def get_extensions(self, extension_point): - """Return the provider's contributions to an extension point.""" + """ + Return the provider's contributions to an extension point. + """ if extension_point == "x": extensions = [42, 43] diff --git a/envisage/ui/tasks/action/task_window_toggle_group.py b/envisage/ui/tasks/action/task_window_toggle_group.py index cd5bb42bf..9978ae002 100644 --- a/envisage/ui/tasks/action/task_window_toggle_group.py +++ b/envisage/ui/tasks/action/task_window_toggle_group.py @@ -52,7 +52,9 @@ def _window_deactivated(self): class TaskWindowToggleGroup(Group): - """A Group for toggling the activation state of an application's windows.""" + """ + A Group for toggling the activation state of an application's windows. + """ #### 'Group' interface #################################################### diff --git a/envisage/ui/tasks/preferences_dialog.py b/envisage/ui/tasks/preferences_dialog.py index 5d5a47e25..96c0e9979 100644 --- a/envisage/ui/tasks/preferences_dialog.py +++ b/envisage/ui/tasks/preferences_dialog.py @@ -61,7 +61,9 @@ class PreferencesDialog(Handler): ########################################################################### def select_pane(self, pane_id): - """Find and activate the notebook tab that contains the given pane id.""" + """ + Find and activate the notebook tab that contains the given pane id. + """ for tab in self._tabs: for pane in tab.panes: if pane.id == pane_id: @@ -116,7 +118,9 @@ def apply(self, info=None): pane.apply() def close(self, info, is_ok): - """Handles the user attempting to close a dialog-based user interface.""" + """ + Handles the user attempting to close a dialog-based user interface. + """ if is_ok: self.apply() return super().close(info, is_ok) diff --git a/envisage/ui/tasks/preferences_pane.py b/envisage/ui/tasks/preferences_pane.py index 971c394c2..bfa89aa84 100644 --- a/envisage/ui/tasks/preferences_pane.py +++ b/envisage/ui/tasks/preferences_pane.py @@ -80,7 +80,9 @@ def apply(self, info=None): self.model.copy_traits(self._model, trait_names) def close(self, info, is_ok): - """Handles the user attempting to close a dialog-based user interface.""" + """ + Handles the user attempting to close a dialog-based user interface. + """ if is_ok: self.apply() return super().close(info, is_ok) diff --git a/envisage/ui/workbench/workbench_action_manager_builder.py b/envisage/ui/workbench/workbench_action_manager_builder.py index 9fc176b8b..d8f0dd310 100644 --- a/envisage/ui/workbench/workbench_action_manager_builder.py +++ b/envisage/ui/workbench/workbench_action_manager_builder.py @@ -22,7 +22,9 @@ class WorkbenchActionManagerBuilder(AbstractActionManagerBuilder): - """The action manager builder used to build the workbench menu/tool bars.""" + """ + The action manager builder used to build the workbench menu/tool bars. + """ #### 'WorkbenchActionManagerBuilder' interface ############################