Skip to content

Commit

Permalink
Minor improvements to edscupdate
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Feb 13, 2015
1 parent ad14af3 commit d6a2f95
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions edscupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ def get_cmdr(tdb):

print("start date: {}".format(date), file=sys.stderr)

confidence = os.environ.get("CONF", 2)

edsq = misc.edsc.StarQuery(
test=testMode,
confidence=2,
confidence=confidence,
date=date,
)
data = edsq.fetch()
Expand Down Expand Up @@ -140,9 +142,12 @@ def ischange(sysinfo):
)
print()

total = len(systems)
current = 0
with open("tmp/new.systems.csv", "a") as output:
try:
for sysinfo in systems:
current += 1
name = sysinfo['name']
x, y, z = sysinfo['coord']
place = sysinfo['place']
Expand Down Expand Up @@ -175,10 +180,12 @@ def ischange(sysinfo):
), file=sys.stderr)
distance = float("{:.2f}".format(dist(x, y, z)))
clip.copy_text(name.lower())
prompt = "'{}'".format(name)
prompt += " ({:.2f}ly)".format(distance)

ok = input(prompt+"? ".format(name))
prompt = "{}/{}: '{}': {:.2f}ly? ".format(
current, total,
name,
distance,
)
ok = input(prompt)
if ok.lower() == 'q':
break
if ok.startswith('='):
Expand Down

0 comments on commit d6a2f95

Please sign in to comment.