Skip to content

Commit

Permalink
Added --illegal and --legal options to 'rare' sub-command
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed May 4, 2015
1 parent c2c0444 commit 5ba59ec
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions commands/rares_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@
default=0,
type=float,
),
MutuallyExclusiveGroup(
ParseArgument('--legal',
help='List only items known to be legal.',
action='store_true',
),
ParseArgument('--illegal',
help='List only items known to be illegal.',
action='store_true',
)
),
ParseArgument('--from',
help='Additional systems to range check candidates against, ' \
'requires --away.',
Expand Down Expand Up @@ -117,6 +127,13 @@ def run(results, cmdenv, tdb):
# How far we're want to cast our net.
maxLy = float(cmdenv.maxLyPer or 0.)

if cmdenv.illegal:
wantIllegality = 'Y'
elif cmdenv.legal:
wantIllegality = 'N'
else:
wantIllegality = 'YN?'

awaySystems = set()
if cmdenv.away or cmdenv.awayFrom:
if not cmdenv.away or not cmdenv.awayFrom:
Expand All @@ -138,6 +155,8 @@ def run(results, cmdenv, tdb):

# Look through the rares list.
for rare in tdb.rareItemByID.values():
if not rare.illegal in wantIllegality:
continue
if padSize: # do we care about pad size?
if not rare.station.checkPadSize(padSize):
continue
Expand Down

0 comments on commit 5ba59ec

Please sign in to comment.