From 54cccfd693939f0f01b0b36767690097cc1c5f90 Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Sun, 24 Oct 2021 21:38:07 +0200 Subject: Commits forgotten changes. --- tonkadur.py | 17 +++++++++++++---- tonkadur_ui.py | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/tonkadur.py b/tonkadur.py index 7353c87..970a362 100644 --- a/tonkadur.py +++ b/tonkadur.py @@ -177,7 +177,16 @@ class Tonkadur: result['effect'] = None result['content'] = [] for c in computation['content']: - result['content'].append(self.compute(c)) + cc = self.compute(c) + + if ( + (type(cc) is dict) + and ('effect' in cc) + and cc['effect'] == None + ): + result['content'].extend(cc['content']) + else: + result['content'].append(cc) return result elif (computation_category == "newline"): @@ -187,7 +196,7 @@ class Tonkadur: return result elif (computation_category == "extra_computation"): - print("[E] Unhandled extra computation " + computation['name']) + print("[E] Unhandled extra computation " + str(computation)) return None elif (computation_category == "size"): @@ -206,8 +215,8 @@ class Tonkadur: access = self.compute(computation['reference']) #print("(value_of " + str(access) + ")") for addr in access: - # print("Reading " + str(addr) + " of " + str(target)) - # print("addr = " + str(addr)) + #print("Reading " + str(addr) + " of " + str(target)) + #print("addr = " + str(addr)) target = target[addr] # if (isinstance(target, list)): # print("That's a list.") diff --git a/tonkadur_ui.py b/tonkadur_ui.py index 2dc563e..6fb5b5b 100644 --- a/tonkadur_ui.py +++ b/tonkadur_ui.py @@ -99,7 +99,7 @@ try: current_choice = 0; for choice in result['options']: - if (choice["category"] == "option"): + if (choice["category"] == "text_option"): print( str(current_choice) + ". " -- cgit v1.2.3-70-g09d2