diff --git a/pupy/modules/lock_screen.py b/pupy/modules/lock_screen.py new file mode 100644 index 00000000..c6198db5 --- /dev/null +++ b/pupy/modules/lock_screen.py @@ -0,0 +1,18 @@ +# -*- coding: UTF8 -*- +from pupylib.PupyModule import * + +__class_name__="PupyMod" + +@config(compat="windows", cat="manage", tags=["lock", "screen", "session"]) +class PupyMod(PupyModule): + """ Lock the session """ + + def init_argparse(self): + self.arg_parser = PupyArgumentParser(prog="lock_screen", description=self.__doc__) + + def run(self, args): + if self.client.conn.modules['ctypes'].windll.user32.LockWorkStation(): + self.success("windows locked") + else: + self.error("couldn't lock the screen") +