From 8e49066ca42134fab85a667a107fe8506df7928b Mon Sep 17 00:00:00 2001 From: A_D Date: Tue, 28 Jul 2020 18:09:25 +0200 Subject: [PATCH] Replaced convoluted or-based logic with terneries --- plugins/inara.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/inara.py b/plugins/inara.py index fd78aafa..9f204b34 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -90,7 +90,7 @@ def station_url(system_name: str, station_name: str): return system_url(system_name) - return this.station or this.system + return this.station if this.station else this.system def plugin_start3(plugin_dir): @@ -166,7 +166,7 @@ def plugin_prefs(parent: tk.Tk, cmdr: str, is_beta: bool): def prefs_cmdr_changed(cmdr: str, is_beta: bool): - this.log_button['state'] = cmdr and not is_beta and tk.NORMAL or tk.DISABLED + this.log_button['state'] = tk.NORMAL if cmdr and not is_beta else tk.DISABLED this.apikey['state'] = tk.NORMAL this.apikey.delete(0, tk.END) if cmdr: @@ -896,8 +896,8 @@ def cmdr_data(data, is_beta): this.station_marketid = data['commander']['docked'] and data['lastStarport']['id'] # Only trust CAPI if these aren't yet set - this.system = this.system or data['lastSystem']['name'] - this.station = this.station or data['commander']['docked'] and data['lastStarport']['name'] + this.system = this.system if this.system else data['lastSystem']['name'] + this.station = data['lastStarport']['name'] if data['commander']['docked'] and not this.station else this.station # Override standard URL functions if config.get('system_provider') == 'Inara':