Skip to content

Commit

Permalink
Ask user for market and shipyard if the api doesn't return one. He sh…
Browse files Browse the repository at this point in the history
…ould know.
  • Loading branch information
tlund committed Nov 21, 2015
1 parent 72c3695 commit a94ec22
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions plugins/edapi_plug.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import textwrap
import time

__version_info__ = ('3', '5', '7')
__version_info__ = ('3', '5', '8')
__version__ = '.'.join(__version_info__)

# ----------------------------------------------------------------
Expand Down Expand Up @@ -3682,16 +3682,20 @@ def run(self):
repair = input(
"Repair present (Y, N or enter for ?): "
) or '?'
# This is unreliable, so default to unknown.
# This is unreliable, so ask the user.
if 'commodities' in api.profile['lastStarport']:
market = 'Y'
else:
market = '?'
# This is also unreliable, so default to unknown.
market = input(
"Commodity market present (Y, N or enter for ?): "
) or '?'
# This is also unreliable, so ask the user.
if 'ships' in api.profile['lastStarport']:
shipyard = 'Y'
else:
shipyard = '?'
shipyard = input(
"Shipyard present (Y, N or enter for ?): "
) or '?'
system_lookup = tdb.lookupSystem(system)
if tdb.addLocalStation(
system=system_lookup,
Expand Down Expand Up @@ -3762,13 +3766,23 @@ def run(self):
"Update repair present (Y, N or enter for ?): "
) or '?'

# This is unreliable, so default to unchanged.
# This is unreliable, so ask the user if unknown.
if 'commodities' in api.profile['lastStarport']:
market = 'Y'
else:
if market is '?':
market = input(
"Commodity market present (Y, N or enter for ?): "
) or '?'

# This is also unreliable, so default to unchanged.
# This is also unreliable, so ask the user if unknown.
if 'ships' in api.profile['lastStarport']:
shipyard = 'Y'
else:
if shipyard is '?':
shipyard = input(
"Shipyard present (Y, N or enter for ?): "
) or '?'

if (
lsFromStar != station_lookup.lsFromStar or
Expand Down

0 comments on commit a94ec22

Please sign in to comment.