Skip to content

Commit

Permalink
Fixes #191 'set' does not support indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Mar 2, 2015
1 parent cf43255 commit d0f3036
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ v6.12.3 Mar 01 2015
. (kfsone) Fixed #188 Allow multiple ships per "shipvendor",
. (kfsone) Fixed #190 "station -r" wasn't updated the .csv file,
. (kfsone) Cleaned up the output of "local" command when showing stations,
. (kfsone) Fixed #191 'set' does not support indexing
+ DRy411S : ShipVendors

v6.12.2 Feb 26 2015
Expand Down
16 changes: 8 additions & 8 deletions commands/run_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def expandForJumps(tdb, cmdenv, origins, jumps, srcName):
for origin in origins:
if isinstance(origin, System):
stations.extend(origin.stations)
return set(stations)
return list(set(stations))

origSys = set()
for place in origins:
Expand Down Expand Up @@ -405,7 +405,7 @@ def expandForJumps(tdb, cmdenv, origins, jumps, srcName):
[sys.name() for sys in origins]
)

return set(origins)
return list(set(origins))


def checkForEmptyStationList(category, focusPlace, stationList, jumps):
Expand Down Expand Up @@ -581,9 +581,9 @@ def checkOrigins(tdb, cmdenv):
if isinstance(cmdenv.origPlace, System) and not cmdenv.startJumps:
cmdenv.origins = filterStationSet('--from', cmdenv, cmdenv.origins)

cmdenv.origSystems = set(
cmdenv.origSystems = list(set(
stn.system for stn in cmdenv.origins
)
))


def checkDestinations(tdb, cmdenv):
Expand Down Expand Up @@ -640,9 +640,9 @@ def checkDestinations(tdb, cmdenv):
cmdenv.destinations
)

cmdenv.destSystems = set(
cmdenv.destSystems = list(set(
stn.system for stn in cmdenv.destinations
)
))

def validateRunArguments(tdb, cmdenv):
"""
Expand Down Expand Up @@ -757,7 +757,7 @@ def validateRunArguments(tdb, cmdenv):
if viaSet:
if len(origins) == 1 and origins[0] in viaSet:
raise("Can't have --from station in --via list with --unique")
if len(destns) == 1 and destns[1] in viaSet:
if len(destns) == 1 and destns[0] in viaSet:
raise("Can't have --to station in --via list with --unique")

if cmdenv.mfd:
Expand Down Expand Up @@ -814,7 +814,7 @@ def filterByVia(routes, viaSet, viaStartPos):
def checkReachability(tdb, cmdenv):
srcSys, dstSys = cmdenv.origSystems, cmdenv.destSystems
if len(srcSys) == 1 and len(dstSys) == 1:
srcSys, dstSys = next(iter(srcSys)), next(iter(dstSys))
srcSys, dstSys = srcSys[0], dstSys[0]
if srcSys != dstSys:
maxLyPer = cmdenv.maxLyPer
avoiding = [
Expand Down

0 comments on commit d0f3036

Please sign in to comment.