From: Christian Heller Date: Mon, 18 Feb 2019 00:50:43 +0000 (+0100) Subject: Remove usage demo code from library. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/%7B%7Bdb.prefix%7D%7D/conditions?a=commitdiff_plain;h=6121e33c4b9fc86ced316406143195fdd3af7a00;p=plomrogue2-experiments Remove usage demo code from library. --- diff --git a/new/plomrogue/misc.py b/new/plomrogue/misc.py index 468680e..93be672 100755 --- a/new/plomrogue/misc.py +++ b/new/plomrogue/misc.py @@ -903,27 +903,3 @@ def quote(string): def stringify_yx(tuple_): """Transform tuple (y,x) into string 'Y:'+str(y)+',X:'+str(x).""" return 'Y:' + str(tuple_[0]) + ',X:' + str(tuple_[1]) - - - -if __name__ == "__main__": - import sys - import os - if len(sys.argv) != 2: - print('wrong number of arguments, expected one (game file)') - exit(1) - game_file_name = sys.argv[1] - game = Game(game_file_name) - if os.path.exists(game_file_name): - if not os.path.isfile(game_file_name): - print('game file name does not refer to a valid game file') - else: - with open(game_file_name, 'r') as f: - lines = f.readlines() - for i in range(len(lines)): - line = lines[i] - print("FILE INPUT LINE %5s: %s" % (i, line), end='') - game.io.handle_input(line, store=False) - else: - game.io.handle_input('GEN_WORLD Y:16,X:16 bar') - game.io.run_loop_with_server()