From 7e32d849e575cec6cec09874bdeb4b1e86e40a26 Mon Sep 17 00:00:00 2001 From: Chris Davoren Date: Fri, 30 Jun 2023 16:58:40 +1000 Subject: [PATCH] Changed command line to use class system. --- sheditor.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/sheditor.py b/sheditor.py index 9dfb4ba..1ad2a0d 100644 --- a/sheditor.py +++ b/sheditor.py @@ -560,6 +560,27 @@ def main(): soup = BeautifulSoup(full_text, "xml") + item_code_database = ItemCodeDatabase('item_ids.txt') + print("Item code database successfully loaded") + + game_data = GameData(soup, item_code_database) + game_data.populate() + + if args.buff_chars: + game_data.buff_characters() + + if args.add_item: + game_data.add_item(args.add_item[0], args.add_item[1]) + + if args.money: + game_data.add_currency(args.money[0]) + + if args.list_ships: + game_data.print_summary() + + game_data.writeback() + + """ # print(soup.prettify()) if args.buff_chars: print('Buffing all characters...') @@ -578,7 +599,8 @@ def main(): if args.list_ships: list_ships(soup) - + + """ if args.test_gamedata: item_code_database = ItemCodeDatabase('item_ids.txt') print("Item code database successfully loaded")