From 95f52717185d5d69f93dafc6ad1a9404e4550db1 Mon Sep 17 00:00:00 2001 From: Alessandro ZANNI Date: Wed, 5 Oct 2016 15:49:52 +0200 Subject: [PATCH] mkdir module --- pupy/modules/mkdir.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 pupy/modules/mkdir.py diff --git a/pupy/modules/mkdir.py b/pupy/modules/mkdir.py new file mode 100644 index 00000000..221f1606 --- /dev/null +++ b/pupy/modules/mkdir.py @@ -0,0 +1,19 @@ +# -*- coding: UTF8 -*- +from pupylib.PupyModule import * +from pupylib.utils.rpyc_utils import redirected_stdio + +__class_name__="mkdir" + +@config(cat="admin") +class mkdir(PupyModule): + """ create an empty directory """ + + def init_argparse(self): + self.arg_parser = PupyArgumentParser(prog="mkdir", description=self.__doc__) + self.arg_parser.add_argument('dir', type=str, help='directory name') + + def run(self, args): + self.client.load_package("pupyutils.basic_cmds") + with redirected_stdio(self.client.conn): + self.client.conn.modules["pupyutils.basic_cmds"].mkdir(args.dir) +