From cbddc6517296e81b39077b65f4ebdd3be2977646 Mon Sep 17 00:00:00 2001 From: n1nj4sec Date: Sun, 24 Jan 2016 17:42:47 +0100 Subject: [PATCH] Updated Writing a module (markdown) --- Writing-a-module.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Writing-a-module.md b/Writing-a-module.md index dc5f2d1..01cdd11 100644 --- a/Writing-a-module.md +++ b/Writing-a-module.md @@ -12,23 +12,23 @@ def MessageBox(text, title): ``` then, simply create a module to load our package and call the function remotely ```python +from pupylib.PupyModule import * + +__class_name__="MsgBoxPopup" + +@compatibility("windows") class MsgBoxPopup(PupyModule): """ Pop up a custom message box """ + dependencies=["pupwinutils.msgbox"] def init_argparse(self): self.arg_parser = PupyArgumentParser(prog="msgbox", description=self.__doc__) self.arg_parser.add_argument('--title', help='msgbox title') self.arg_parser.add_argument('text', help='text to print in the msgbox :)') - @windows_only - def is_compatible(self): - pass - def run(self, args): - self.client.load_package("pupwinutils.msgbox") self.client.conn.modules['pupwinutils.msgbox'].MessageBox(args.text, args.title) self.log("message box popped !") - ``` and that's it, we have a fully functional module :)