From adc9eb0a3b496248736d21d238246e73c1d1ccab Mon Sep 17 00:00:00 2001 From: Homer S Date: Wed, 30 Jun 2021 23:36:51 +0200 Subject: [PATCH] Changed main() to fritzab2matrix.py to not to mix up with the __main__ function. Also removed the while loop in the latter which didn't work despite of the recursive function. Also removed the recursive ended_call(main, env_ip) because that broke the script on one tested machine. --- fritzab2matrix.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/fritzab2matrix.py b/fritzab2matrix.py index 2b1d3cf..b792aeb 100755 --- a/fritzab2matrix.py +++ b/fritzab2matrix.py @@ -26,7 +26,7 @@ if env_voicebox is None: if env_tmp is None: env_tmp = "/tmp" -def main(): +def fritzab2matrix(): ### CHECK AND GET MESSAGES FROM FRITZBOX ### ############################################ @@ -119,19 +119,16 @@ def main(): continue continue - ### Monitor the FritzBox and trigger the main script whenever a call disconnects ### - ################################################################################### - endedCall(main, env_ip) if __name__ == "__main__": - print("I enter the main loop ...") - while main(): - pass - else: - print("I left the main loop!") + fritzab2matrix() + ### Monitor the FritzBox and trigger the main script whenever a call disconnects ### + ################################################################################### + endedCall(fritzab2matrix, env_ip) +