Skip to content

Commit

Permalink
Fix for station-to-station route
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Jan 11, 2015
1 parent 6096a4b commit 555bc3e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions commands/run_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,30 @@ def checkAnchorNotInVia(hops, anchorName, place, viaSet):
))


def checkStationSuitability(cmdenv, station, src):
if not station.itemCount:
raise NoDataError(
"No price data in local database "
"for {} station: {}".format(
src, station.name(),
))
mps = cmdenv.maxPadSize
if mps and not station.checkPadSize(mps):
raise CommandLineError(
"{} station {} does not meet pad-size "
"requirement.".format(
src, station.name(),
))
if src != "--from":
bm = cmdenv.blackMarket
if bm and station.blackMarket != 'Y':
raise CommandLineError(
"{} station {} does not meet black-market "
"requirement.".format(
src, station.name(),
))


def filterStationSet(src, cmdenv, stnSet):
if not stnSet:
return stnSet
Expand Down Expand Up @@ -405,6 +429,7 @@ def validateRunArguments(tdb, cmdenv):
.format(cmdenv.origPlace.name())
)
else:
checkStationSuitability(cmdenv, cmdenv.origPlace, '--from')
cmdenv.origins = [ cmdenv.origPlace ]
cmdenv.startStation = cmdenv.origPlace
cmdenv.origins = expandForJumps(
Expand Down

0 comments on commit 555bc3e

Please sign in to comment.