From 8e7022f73b332a7946d2c971e6d672a1a54b032f Mon Sep 17 00:00:00 2001 From: Nikolaos Ftylitakis Date: Tue, 22 Oct 2024 14:14:21 +0300 Subject: [PATCH] fixc indentation typo --- .../apps/demo_console/lora_custom_encoding.py | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/insighioNode/apps/demo_console/lora_custom_encoding.py b/insighioNode/apps/demo_console/lora_custom_encoding.py index 966e1ac..5e6245c 100644 --- a/insighioNode/apps/demo_console/lora_custom_encoding.py +++ b/insighioNode/apps/demo_console/lora_custom_encoding.py @@ -142,22 +142,22 @@ def get_location_by_key(key): elif position == "adp2": return LOCATION_AD_P2 elif position[0] >= "0" and position[0] <= "9": - if len(parts) >= 3: # format: sdi12_0_2 -> location_address_port - port = None - try: - port = int(parts[-1]) - except: - logging.error("---!---error parsing port: {}".format(port)) + if len(parts) >= 3: # format: sdi12_0_2 -> location_address_port + port = None + try: + port = int(parts[-1]) + except: + logging.error("---!---error parsing port: {}".format(port)) - if port: - position_int = int(parts[-2]) + if port: + position_int = int(parts[-2]) - if port == 1: - return LOCATION_SDI12_PORT_1 + position_int - elif port == 2: - return LOCATION_SDI12_PORT_2 + position_int - position_int = int(position[0]) - return LOCATION_SDI12 + position_int + if port == 1: + return LOCATION_SDI12_PORT_1 + position_int + elif port == 2: + return LOCATION_SDI12_PORT_2 + position_int + position_int = int(position[0]) + return LOCATION_SDI12 + position_int logging.error("returning default location for key: " + key) return LOCATION_DEFAULT