mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-06 10:23:06 +03:00
Added newline after scope changes
This commit is contained in:
parent
4eed4404c6
commit
37181264c9
@ -47,8 +47,10 @@ this.station_marketid = None
|
|||||||
def system_url(system_name: str) -> str:
|
def system_url(system_name: str) -> str:
|
||||||
if this.system_address:
|
if this.system_address:
|
||||||
return requests.utils.requote_uri(f'https://eddb.io/system/ed-address/{this.system_address}')
|
return requests.utils.requote_uri(f'https://eddb.io/system/ed-address/{this.system_address}')
|
||||||
|
|
||||||
elif system_name:
|
elif system_name:
|
||||||
return requests.utils.requote_uri(f'https://eddb.io/system/name/{system_name}')
|
return requests.utils.requote_uri(f'https://eddb.io/system/name/{system_name}')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
@ -56,6 +58,7 @@ def system_url(system_name: str) -> str:
|
|||||||
def station_url(system_name: str, station_name: str) -> str:
|
def station_url(system_name: str, station_name: str) -> str:
|
||||||
if this.station_marketid:
|
if this.station_marketid:
|
||||||
return requests.utils.requote_uri(f'https://eddb.io/station/market-id/{this.station_marketid}')
|
return requests.utils.requote_uri(f'https://eddb.io/station/market-id/{this.station_marketid}')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
return system_url('')
|
return system_url('')
|
||||||
|
|
||||||
@ -78,6 +81,7 @@ def prefs_changed(cmdr, is_beta):
|
|||||||
# Override standard URL functions
|
# Override standard URL functions
|
||||||
if config.get('system_provider') == 'eddb':
|
if config.get('system_provider') == 'eddb':
|
||||||
this.system_link['url'] = system_url(this.system)
|
this.system_link['url'] = system_url(this.system)
|
||||||
|
|
||||||
if config.get('station_provider') == 'eddb':
|
if config.get('station_provider') == 'eddb':
|
||||||
this.station_link['url'] = station_url(this.system, this.station)
|
this.station_link['url'] = station_url(this.system, this.station)
|
||||||
|
|
||||||
@ -118,6 +122,7 @@ def cmdr_data(data, is_beta):
|
|||||||
# Always store initially, even if we're not the *current* system provider.
|
# Always store initially, even if we're not the *current* system provider.
|
||||||
if not this.station_marketid:
|
if not this.station_marketid:
|
||||||
this.station_marketid = data['commander']['docked'] and data['lastStarport']['id']
|
this.station_marketid = data['commander']['docked'] and data['lastStarport']['id']
|
||||||
|
|
||||||
# Only trust CAPI if these aren't yet set
|
# Only trust CAPI if these aren't yet set
|
||||||
this.system = this.system or data['lastSystem']['name']
|
this.system = this.system or data['lastSystem']['name']
|
||||||
this.station = this.station or data['commander']['docked'] and data['lastStarport']['name']
|
this.station = this.station or data['commander']['docked'] and data['lastStarport']['name']
|
||||||
@ -127,11 +132,14 @@ def cmdr_data(data, is_beta):
|
|||||||
this.system_link['text'] = this.system
|
this.system_link['text'] = this.system
|
||||||
this.system_link['url'] = system_url(this.system)
|
this.system_link['url'] = system_url(this.system)
|
||||||
this.system_link.update_idletasks()
|
this.system_link.update_idletasks()
|
||||||
|
|
||||||
if config.get('station_provider') == 'eddb':
|
if config.get('station_provider') == 'eddb':
|
||||||
if data['commander']['docked']:
|
if data['commander']['docked']:
|
||||||
this.station_link['text'] = this.station
|
this.station_link['text'] = this.station
|
||||||
|
|
||||||
elif data['lastStarport']['name'] and data['lastStarport']['name'] != "":
|
elif data['lastStarport']['name'] and data['lastStarport']['name'] != "":
|
||||||
this.station_link['text'] = STATION_UNDOCKED
|
this.station_link['text'] = STATION_UNDOCKED
|
||||||
|
|
||||||
else:
|
else:
|
||||||
this.station_link['text'] = ''
|
this.station_link['text'] = ''
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user