From fc0719c58b2353ba9c073132334caa920a57119b Mon Sep 17 00:00:00 2001 From: Alessandro ZANNI Date: Wed, 5 Oct 2016 15:49:44 +0200 Subject: [PATCH] ls module --- pupy/modules/ls.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 pupy/modules/ls.py diff --git a/pupy/modules/ls.py b/pupy/modules/ls.py new file mode 100644 index 00000000..5773acb6 --- /dev/null +++ b/pupy/modules/ls.py @@ -0,0 +1,19 @@ +# -*- coding: UTF8 -*- +from pupylib.PupyModule import * +from pupylib.utils.rpyc_utils import redirected_stdio + +__class_name__="ls" + +@config(cat="admin") +class ls(PupyModule): + """ list system files """ + + def init_argparse(self): + self.arg_parser = PupyArgumentParser(prog="ls", description=self.__doc__) + self.arg_parser.add_argument('path', type=str, nargs='?', help='path of a specific file') + + def run(self, args): + self.client.load_package("pupyutils.basic_cmds") + with redirected_stdio(self.client.conn): + self.client.conn.modules["pupyutils.basic_cmds"].ls(args.path) +