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 :)