From ae9ae91af56d010201e27e81685c3abb2424f25b Mon Sep 17 00:00:00 2001 From: Mike Kinney Date: Sat, 15 Jan 2022 00:24:41 -0800 Subject: [PATCH] remove dead code --- meshtastic/__main__.py | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/meshtastic/__main__.py b/meshtastic/__main__.py index a4b1560..042b3aa 100644 --- a/meshtastic/__main__.py +++ b/meshtastic/__main__.py @@ -141,24 +141,12 @@ def setPref(attributes, name, valStr): print(f" {temp_name}") return - # okay - try to read the value - try: - try: - setattr(attributes, snake_name, val) - except TypeError: - # The setter didn't like our arg type guess try again as a string - setattr(attributes, snake_name, valStr) + setattr(attributes, snake_name, val) - # succeeded! - if Globals.getInstance().get_camel_case(): - print(f"Set {camel_name} to {valStr}") - else: - print(f"Set {snake_name} to {valStr}") - except Exception as ex: - if Globals.getInstance().get_camel_case(): - print(f"Can't set {camel_name} due to {ex}") - else: - print(f"Can't set {snake_name} due to {ex}") + if Globals.getInstance().get_camel_case(): + print(f"Set {camel_name} to {valStr}") + else: + print(f"Set {snake_name} to {valStr}") def onConnected(interface):