From a91e896b209f34f5794467186aa7287de0d1f775 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 25 Sep 2021 00:56:03 +0200 Subject: [PATCH] move sample code into own file --- InvenTree/plugins/action/action.py | 22 ----------------- .../plugins/action/simpleactionplugin.py | 24 +++++++++++++++++++ 2 files changed, 24 insertions(+), 22 deletions(-) create mode 100644 InvenTree/plugins/action/simpleactionplugin.py diff --git a/InvenTree/plugins/action/action.py b/InvenTree/plugins/action/action.py index 8b9ed6aec9..16e63a3a5c 100644 --- a/InvenTree/plugins/action/action.py +++ b/InvenTree/plugins/action/action.py @@ -68,25 +68,3 @@ class ActionPlugin(plugin.InvenTreePlugin): "result": self.get_result(), "info": self.get_info(), } - - -class SimpleActionPlugin(ActionPlugin): - """ - An EXTREMELY simple action plugin which demonstrates - the capability of the ActionPlugin class - """ - - PLUGIN_NAME = "SimpleActionPlugin" - ACTION_NAME = "simple" - - def perform_action(self): - print("Action plugin in action!") - - def get_info(self): - return { - "user": self.user.username, - "hello": "world", - } - - def get_result(self): - return True diff --git a/InvenTree/plugins/action/simpleactionplugin.py b/InvenTree/plugins/action/simpleactionplugin.py new file mode 100644 index 0000000000..95a50ddbca --- /dev/null +++ b/InvenTree/plugins/action/simpleactionplugin.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +from plugins.action.action import ActionPlugin + + +class SimpleActionPlugin(ActionPlugin): + """ + An EXTREMELY simple action plugin which demonstrates + the capability of the ActionPlugin class + """ + + PLUGIN_NAME = "SimpleActionPlugin" + ACTION_NAME = "simple" + + def perform_action(self): + print("Action plugin in action!") + + def get_info(self): + return { + "user": self.user.username, + "hello": "world", + } + + def get_result(self): + return True