From be3bb05eddff6f202affeb0753dc17d9cfc69f7e Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 30 Dec 2021 23:06:28 +1100 Subject: [PATCH] Improve docstrings --- .../plugin/builtin/integration/mixins.py | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/InvenTree/plugin/builtin/integration/mixins.py b/InvenTree/plugin/builtin/integration/mixins.py index 0af66333cb..03922603a7 100644 --- a/InvenTree/plugin/builtin/integration/mixins.py +++ b/InvenTree/plugin/builtin/integration/mixins.py @@ -11,7 +11,7 @@ class GlobalSettingsMixin: """ Mixin that enables global settings for the plugin """ - + class MixinMeta: MIXIN_NAME = 'Settings' @@ -22,28 +22,30 @@ class GlobalSettingsMixin: def setup_globalsettings(self): """ - setup global settings for this plugin + Setup global settings for this plugin """ return getattr(self, 'SETTINGS', None) @property def has_globalsettings(self): """ - does this plugin use custom global settings + Does this plugin use custom global settings """ return bool(self.globalsettings) @property def globalsettingspatterns(self): """ - get patterns for InvenTreeSetting defintion + Get patterns for InvenTreeSetting defintion """ if self.has_globalsettings: return {f'PLUGIN_{self.slug.upper()}_{key}': value for key, value in self.globalsettings.items()} return None def _globalsetting_name(self, key): - """get global name of setting""" + """ + Get global name of setting + """ return f'PLUGIN_{self.slug.upper()}_{key}' def get_globalsetting(self, key): @@ -62,9 +64,11 @@ class GlobalSettingsMixin: class UrlsMixin: - """Mixin that enables urls for the plugin""" + """ + Mixin that enables custom URLs for the plugin + """ + class MixinMeta: - """meta options for this mixin""" MIXIN_NAME = 'URLs' def __init__(self): @@ -110,7 +114,10 @@ class UrlsMixin: class NavigationMixin: - """Mixin that enables adding navigation links with the plugin""" + """ + Mixin that enables custom navigation links with the plugin + """ + NAVIGATION_TAB_NAME = None NAVIGATION_TAB_ICON = "fas fa-question" @@ -157,7 +164,10 @@ class NavigationMixin: class AppMixin: - """Mixin that enables full django app functions for a plugin""" + """ + Mixin that enables full django app functions for a plugin + """ + class MixinMeta: """meta options for this mixin""" MIXIN_NAME = 'App registration'