From 05aa71129d633eb3352163d2c0c1a44f41a14afc Mon Sep 17 00:00:00 2001 From: Yannick Ulrich <yannick.ulrich@psi.ch> Date: Fri, 21 Feb 2020 12:48:15 +0100 Subject: [PATCH] Towards #6: create file --- pymule/__main__.py | 2 ++ pymule/duplicaterun.py | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 pymule/duplicaterun.py diff --git a/pymule/__main__.py b/pymule/__main__.py index 1fbcf3a..499766f 100644 --- a/pymule/__main__.py +++ b/pymule/__main__.py @@ -1,5 +1,6 @@ import argparse import createrun +import duplicaterun if __name__ == '__main__': @@ -7,6 +8,7 @@ if __name__ == '__main__': subparsers = parser.add_subparsers() createrun.create_parser(subparsers) + duplicaterun.create_parser(subparsers) parsed = parser.parse_args() parsed.func(parsed) diff --git a/pymule/duplicaterun.py b/pymule/duplicaterun.py new file mode 100644 index 0000000..dfaa2af --- /dev/null +++ b/pymule/duplicaterun.py @@ -0,0 +1,11 @@ +def create_parser(subparsers): + parser = subparsers.add_parser( + 'cp', + description='Copies a set run with or without data to a ' + 'new location relative to pwd' + ) + parser.set_defaults(func=main) + + +def main(parsed): + print parsed -- GitLab