mkdir module

This commit is contained in:
Alessandro ZANNI 2016-10-05 15:49:52 +02:00
parent fc0719c58b
commit 95f5271718
1 changed files with 19 additions and 0 deletions

19
pupy/modules/mkdir.py Normal file
View File

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