move sample code into own file

This commit is contained in:
Matthias 2021-09-25 00:56:03 +02:00
parent 5a2c2b96ec
commit a91e896b20
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 24 additions and 22 deletions

View File

@ -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

View File

@ -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