From 9a3d125b4872fea3f7f13d90261eb31d931896e4 Mon Sep 17 00:00:00 2001 From: Ruben de Vries Date: Fri, 18 Mar 2016 12:23:21 +0100 Subject: [PATCH] easy tool to copy scenarios --- tools/copyscenarios.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 tools/copyscenarios.py diff --git a/tools/copyscenarios.py b/tools/copyscenarios.py new file mode 100755 index 00000000..57af39a7 --- /dev/null +++ b/tools/copyscenarios.py @@ -0,0 +1,15 @@ +#!/usr/bin/python + +import os +import re +import shutil + +DIR = "counterpartylib/test/fixtures/scenarios" +REGEX = r"^(?P.*)\.new(?P\..*)$" + +for file in sorted(os.listdir(DIR)): + m = re.match(REGEX, file) + if m: + newfile = m.group('name') + m.group('ext') + print("%s -> %s" % (file, newfile)) + shutil.copy(os.path.join(DIR, file), os.path.join(DIR, newfile))