From 42594c93661956ebced19418dc70132f03b79f7b Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 15 Oct 2021 11:57:09 +0100 Subject: [PATCH] EDDN: Abbreviate tracking_ui_update() code --- plugins/eddn.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/plugins/eddn.py b/plugins/eddn.py index a7afd2a9..e6aa9431 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -996,19 +996,16 @@ def plugin_app(parent: tk.Tk) -> Optional[tk.Frame]: def tracking_ui_update() -> None: """Update the Tracking UI with current data.""" - if this.body_name is None: - this.ui_j_body_name['text'] = '≪None≫' - else: + this.ui_j_body_name['text'] = '≪None≫' + if this.body_name is not None: this.ui_j_body_name['text'] = this.body_name - if this.body_id is None: - this.ui_j_body_id['text'] = '≪None≫' - else: + this.ui_j_body_id['text'] = '≪None≫' + if this.body_id is not None: this.ui_j_body_id['text'] = str(this.body_id) - if this.status_body_name is None: - this.ui_s_body_name['text'] = '≪None≫' - else: + this.ui_s_body_name['text'] = '≪None≫' + if this.status_body_name is not None: this.ui_s_body_name['text'] = this.status_body_name this.ui.update_idletasks()