From 0ab955793680319057548346c7e3d74edc5575b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20=C5=9Eahin?= Date: Wed, 13 Jul 2016 17:40:30 +0300 Subject: [PATCH] sample plugin adapted to new modes --- opt/ahenk/plugins/sample/init.py | 20 ++++++++++++++++++++ opt/ahenk/plugins/sample/login.py | 21 +++++++++++++++++++++ opt/ahenk/plugins/sample/logout.py | 21 +++++++++++++++++++++ opt/ahenk/plugins/sample/safe.py | 21 +++++++++++++++++++++ opt/ahenk/plugins/sample/shutdown.py | 20 ++++++++++++++++++++ 5 files changed, 103 insertions(+) create mode 100644 opt/ahenk/plugins/sample/init.py create mode 100644 opt/ahenk/plugins/sample/login.py create mode 100644 opt/ahenk/plugins/sample/logout.py create mode 100644 opt/ahenk/plugins/sample/safe.py create mode 100644 opt/ahenk/plugins/sample/shutdown.py diff --git a/opt/ahenk/plugins/sample/init.py b/opt/ahenk/plugins/sample/init.py new file mode 100644 index 0000000..f8162b3 --- /dev/null +++ b/opt/ahenk/plugins/sample/init.py @@ -0,0 +1,20 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- + +from base.plugin.abstract_plugin import AbstractPlugin + + +class Init(AbstractPlugin): + def __init__(self, context): + super(Init, self).__init__() + self.context = context + self.logger = self.get_logger() + + def handle_mode(self): + # TODO Do what do you want to do! + pass + + +def handle_mode(context): + init = Init(context) + init.handle_mode() diff --git a/opt/ahenk/plugins/sample/login.py b/opt/ahenk/plugins/sample/login.py new file mode 100644 index 0000000..5e8119c --- /dev/null +++ b/opt/ahenk/plugins/sample/login.py @@ -0,0 +1,21 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- + +from base.plugin.abstract_plugin import AbstractPlugin + + +class Login(AbstractPlugin): + def __init__(self, context): + super(Login, self).__init__() + self.context = context + self.username = str(context.get_username()) + self.logger = self.get_logger() + + def handle_mode(self): + # TODO Do what do you want to do! + pass + + +def handle_mode(context): + login = Login(context) + login.handle_mode() diff --git a/opt/ahenk/plugins/sample/logout.py b/opt/ahenk/plugins/sample/logout.py new file mode 100644 index 0000000..6c17985 --- /dev/null +++ b/opt/ahenk/plugins/sample/logout.py @@ -0,0 +1,21 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- + +from base.plugin.abstract_plugin import AbstractPlugin + + +class Logout(AbstractPlugin): + def __init__(self, context): + super(Logout, self).__init__() + self.context = context + self.username = str(context.get_username()) + self.logger = self.get_logger() + + def handle_mode(self): + # TODO Do what do you want to do! + pass + + +def handle_mode(context): + logout = Logout(context) + logout.handle_mode() diff --git a/opt/ahenk/plugins/sample/safe.py b/opt/ahenk/plugins/sample/safe.py new file mode 100644 index 0000000..2debd2e --- /dev/null +++ b/opt/ahenk/plugins/sample/safe.py @@ -0,0 +1,21 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- + +from base.plugin.abstract_plugin import AbstractPlugin + + +class Safe(AbstractPlugin): + def __init__(self, context): + super(Safe, self).__init__() + self.context = context + self.username = str(context.get_username()) + self.logger = self.get_logger() + + def handle_safe_mode(self): + # TODO Do what do you want to do! + pass + + +def handle_mode(context): + safe = Safe(context) + safe.handle_safe_mode() diff --git a/opt/ahenk/plugins/sample/shutdown.py b/opt/ahenk/plugins/sample/shutdown.py new file mode 100644 index 0000000..cda1972 --- /dev/null +++ b/opt/ahenk/plugins/sample/shutdown.py @@ -0,0 +1,20 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- + +from base.plugin.abstract_plugin import AbstractPlugin + + +class Shutdown(AbstractPlugin): + def __init__(self, context): + super(Shutdown, self).__init__() + self.context = context + self.logger = self.get_logger() + + def handle_mode(self): + # TODO Do what do you want to do! + pass + + +def handle_mode(context): + shutdown = Shutdown(context) + shutdown.handle_mode()