From 9391cb7e3c8087e39334f3e88c3c19c32b4151fb Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 5 Mar 2016 18:45:25 +0200 Subject: [PATCH] Make level convertor take arguments --- koperkapel/levels/l2 | 5 ----- koperkapel/levels/level_converter.py | 7 ++++++- koperkapel/levels/t2 | 5 ----- 3 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 koperkapel/levels/l2 delete mode 100644 koperkapel/levels/t2 diff --git a/koperkapel/levels/l2 b/koperkapel/levels/l2 deleted file mode 100644 index d53575e..0000000 --- a/koperkapel/levels/l2 +++ /dev/null @@ -1,5 +0,0 @@ -wwwwwwwwww -wffffffffw -wsgffgfffw -wffffffffw -wwwwwwwwww \ No newline at end of file diff --git a/koperkapel/levels/level_converter.py b/koperkapel/levels/level_converter.py index 8949de6..f03bd3e 100644 --- a/koperkapel/levels/level_converter.py +++ b/koperkapel/levels/level_converter.py @@ -1,5 +1,6 @@ import os import json +import sys ATTRIBUTE_MAP = { ' ': {'floor': {'base': 'floor', @@ -96,4 +97,8 @@ class level_generator: if __name__ == '__main__': l = level_generator() - l.convert('l2', 't2') + if len(sys.argv) != 3: + print("Usage %s " % sys.argv[0]) + #l.convert('l2', 't2') + else: + l.convert(sys.argv[1], sys.argv[2]) diff --git a/koperkapel/levels/t2 b/koperkapel/levels/t2 deleted file mode 100644 index f401896..0000000 --- a/koperkapel/levels/t2 +++ /dev/null @@ -1,5 +0,0 @@ -tttttttttt -tttttttttt -tt-----ttt -tttttttttt -tttttttttt \ No newline at end of file -- 2.34.1