mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
add regions for easier code nav
This commit is contained in:
parent
367c37bbaf
commit
28af5dc128
@ -289,7 +289,7 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
|||||||
def _is_package(self):
|
def _is_package(self):
|
||||||
return getattr(self, 'is_package', False)
|
return getattr(self, 'is_package', False)
|
||||||
|
|
||||||
# properties
|
# region properties
|
||||||
@property
|
@property
|
||||||
def slug(self):
|
def slug(self):
|
||||||
"""slug for the plugin"""
|
"""slug for the plugin"""
|
||||||
@ -353,6 +353,7 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
|||||||
"""returns license of plugin"""
|
"""returns license of plugin"""
|
||||||
license = getattr(self, 'LICENSE', None)
|
license = getattr(self, 'LICENSE', None)
|
||||||
return license
|
return license
|
||||||
|
# endregion
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def package_path(self):
|
def package_path(self):
|
||||||
@ -361,7 +362,7 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
|||||||
return self.__module__
|
return self.__module__
|
||||||
return pathlib.Path(self.def_path).relative_to(settings.BASE_DIR)
|
return pathlib.Path(self.def_path).relative_to(settings.BASE_DIR)
|
||||||
|
|
||||||
# mixins
|
# region mixins
|
||||||
def mixin(self, key):
|
def mixin(self, key):
|
||||||
"""check if mixin is registered"""
|
"""check if mixin is registered"""
|
||||||
return key in self._mixins
|
return key in self._mixins
|
||||||
@ -372,8 +373,9 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
|||||||
fnc_name = self._mixins.get(key)
|
fnc_name = self._mixins.get(key)
|
||||||
return getattr(self, fnc_name, True)
|
return getattr(self, fnc_name, True)
|
||||||
return False
|
return False
|
||||||
|
# endregion
|
||||||
|
|
||||||
# package info
|
# region package info
|
||||||
def get_package_commit(self):
|
def get_package_commit(self):
|
||||||
"""get last git commit for plugin"""
|
"""get last git commit for plugin"""
|
||||||
return get_git_log(self.def_path)
|
return get_git_log(self.def_path)
|
||||||
@ -402,3 +404,4 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
|||||||
# set variables
|
# set variables
|
||||||
self.package = package
|
self.package = package
|
||||||
self.sign_state = sign_state
|
self.sign_state = sign_state
|
||||||
|
# endregion
|
||||||
|
Loading…
Reference in New Issue
Block a user