mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-12-23 13:22:17 +03:00
sample plugins
This commit is contained in:
parent
cc338e94f5
commit
d3b621baac
6 changed files with 54 additions and 0 deletions
24
opt/ahenk/plugins/plugin1/command1.py
Normal file
24
opt/ahenk/plugins/plugin1/command1.py
Normal file
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
# Author: İsmail BAŞARAN <ismail.basaran@tubitak.gov.tr> <basaran.ismaill@gmail.com>
|
||||
|
||||
from base.plugin.AbstractCommand import AbstractCommand
|
||||
|
||||
class MySamplePlugin(AbstractCommand):
|
||||
"""docstring for MySamplePlugin"""
|
||||
def __init__(self, task):
|
||||
super(MySamplePlugin, self).__init__()
|
||||
self.task = task
|
||||
|
||||
def handle_task(self):
|
||||
print("This is command 1 ")
|
||||
print("parameter map="+self.task.parameter_map)
|
||||
|
||||
|
||||
def handle_task(task,context):
|
||||
# Do what ever you want here
|
||||
# You can create command class but it is not necessary
|
||||
# You can use directly this method.
|
||||
context.put('my_data_name','my data')
|
||||
myPlugin = MySamplePlugin(task)
|
||||
myPlugin.handle_task()
|
0
opt/ahenk/plugins/plugin1/command2.py
Normal file
0
opt/ahenk/plugins/plugin1/command2.py
Normal file
8
opt/ahenk/plugins/plugin1/main.py
Normal file
8
opt/ahenk/plugins/plugin1/main.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
# Author: İsmail BAŞARAN <ismail.basaran@tubitak.gov.tr> <basaran.ismaill@gmail.com>
|
||||
|
||||
|
||||
|
||||
def info():
|
||||
return None
|
9
opt/ahenk/plugins/plugin1/policy.py
Normal file
9
opt/ahenk/plugins/plugin1/policy.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
# Author: İsmail BAŞARAN <ismail.basaran@tubitak.gov.tr> <basaran.ismaill@gmail.com>
|
||||
|
||||
|
||||
def handle_policy(profile_data,context):
|
||||
context.put('data','dataa')
|
||||
context.put('content_type','type')
|
||||
print("This is policy file - plugin 1")
|
7
opt/ahenk/plugins/plugin1/safe.py
Normal file
7
opt/ahenk/plugins/plugin1/safe.py
Normal file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
# Author: İsmail BAŞARAN <ismail.basaran@tubitak.gov.tr> <basaran.ismaill@gmail.com>
|
||||
|
||||
|
||||
def handle_safe_mode(username,context):
|
||||
pass
|
6
opt/ahenk/plugins/plugin2/main.py
Normal file
6
opt/ahenk/plugins/plugin2/main.py
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/python3
|
||||
# -*- coding: utf-8 -*-
|
||||
# Author: İsmail BAŞARAN <ismail.basaran@tubitak.gov.tr> <basaran.ismaill@gmail.com>
|
||||
|
||||
def run(val):
|
||||
print("oo yeah plugin2 " + str(val))
|
Loading…
Reference in a new issue