From 7a551bf9d1431cec9dd47999f95fc53fed1b7e9d Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 26 Sep 2021 14:47:45 +0200 Subject: [PATCH] refactor of file structure --- InvenTree/plugins/{action => }/action.py | 0 InvenTree/plugins/{integration => }/integration.py | 1 - InvenTree/plugins/plugins.py | 8 ++++---- InvenTree/plugins/{ => samples}/action/__init__.py | 0 .../plugins/{ => samples}/action/simpleactionplugin.py | 0 InvenTree/plugins/{ => samples}/integration/__init__.py | 0 .../plugins/{ => samples}/integration/another_sample.py | 2 +- InvenTree/plugins/{ => samples}/integration/sample.py | 2 +- 8 files changed, 6 insertions(+), 7 deletions(-) rename InvenTree/plugins/{action => }/action.py (100%) rename InvenTree/plugins/{integration => }/integration.py (98%) rename InvenTree/plugins/{ => samples}/action/__init__.py (100%) rename InvenTree/plugins/{ => samples}/action/simpleactionplugin.py (100%) rename InvenTree/plugins/{ => samples}/integration/__init__.py (100%) rename InvenTree/plugins/{ => samples}/integration/another_sample.py (82%) rename InvenTree/plugins/{ => samples}/integration/sample.py (91%) diff --git a/InvenTree/plugins/action/action.py b/InvenTree/plugins/action.py similarity index 100% rename from InvenTree/plugins/action/action.py rename to InvenTree/plugins/action.py diff --git a/InvenTree/plugins/integration/integration.py b/InvenTree/plugins/integration.py similarity index 98% rename from InvenTree/plugins/integration/integration.py rename to InvenTree/plugins/integration.py index ab8e71927c..974f6fa49e 100644 --- a/InvenTree/plugins/integration/integration.py +++ b/InvenTree/plugins/integration.py @@ -164,7 +164,6 @@ def get_git_log(path): path = path.replace(os.path.dirname(settings.BASE_DIR), '')[1:] command = ['git', 'log', '-n', '1', "--pretty=format:'%H%n%aN%n%aE%n%aI%n%f%n%G?%n%GK'", '--follow', '--', path] try: - output = str(subprocess.check_output(command, cwd=os.path.dirname(settings.BASE_DIR)), 'utf-8')[1:-1].split('\n') except subprocess.CalledProcessError: output = 7 * [''] return {'hash': output[0], 'author': output[1], 'mail': output[2], 'date': output[3], 'message': output[4], 'verified': output[5], 'key': output[6]} diff --git a/InvenTree/plugins/plugins.py b/InvenTree/plugins/plugins.py index 79a5a3f40e..0435a023f4 100644 --- a/InvenTree/plugins/plugins.py +++ b/InvenTree/plugins/plugins.py @@ -7,11 +7,11 @@ import pkgutil import logging # Action plugins -import plugins.action as action -from plugins.action.action import ActionPlugin +import plugins.samples.action as action +from plugins.action import ActionPlugin -import plugins.integration as integration -from plugins.integration.integration import IntegrationPlugin +import plugins.samples.integration as integration +from plugins.integration import IntegrationPlugin logger = logging.getLogger("inventree") diff --git a/InvenTree/plugins/action/__init__.py b/InvenTree/plugins/samples/action/__init__.py similarity index 100% rename from InvenTree/plugins/action/__init__.py rename to InvenTree/plugins/samples/action/__init__.py diff --git a/InvenTree/plugins/action/simpleactionplugin.py b/InvenTree/plugins/samples/action/simpleactionplugin.py similarity index 100% rename from InvenTree/plugins/action/simpleactionplugin.py rename to InvenTree/plugins/samples/action/simpleactionplugin.py diff --git a/InvenTree/plugins/integration/__init__.py b/InvenTree/plugins/samples/integration/__init__.py similarity index 100% rename from InvenTree/plugins/integration/__init__.py rename to InvenTree/plugins/samples/integration/__init__.py diff --git a/InvenTree/plugins/integration/another_sample.py b/InvenTree/plugins/samples/integration/another_sample.py similarity index 82% rename from InvenTree/plugins/integration/another_sample.py rename to InvenTree/plugins/samples/integration/another_sample.py index 0dd2eb9996..fc3f8d1b23 100644 --- a/InvenTree/plugins/integration/another_sample.py +++ b/InvenTree/plugins/samples/integration/another_sample.py @@ -1,5 +1,5 @@ """sample implementation for IntegrationPlugin""" -from plugins.integration.integration import IntegrationPlugin, UrlsMixin +from plugins.integration import IntegrationPlugin, UrlsMixin class NoIntegrationPlugin(IntegrationPlugin): diff --git a/InvenTree/plugins/integration/sample.py b/InvenTree/plugins/samples/integration/sample.py similarity index 91% rename from InvenTree/plugins/integration/sample.py rename to InvenTree/plugins/samples/integration/sample.py index 8fa2be5ffa..8e1c7c6894 100644 --- a/InvenTree/plugins/integration/sample.py +++ b/InvenTree/plugins/samples/integration/sample.py @@ -1,5 +1,5 @@ """sample implementations for IntegrationPlugin""" -from plugins.integration.integration import SettingsMixin, UrlsMixin, NavigationMixin, IntegrationPlugin +from plugins.integration import SettingsMixin, UrlsMixin, NavigationMixin, IntegrationPlugin from django.http import HttpResponse from django.utils.translation import ugettext_lazy as _