Skip to content

Commit

Permalink
If TEST=1 is set, use data/test-stars.txt for submit-distances.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Feb 22, 2015
1 parent e4687d5 commit bed80eb
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions submit-distances.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,25 @@ def send_and_check_distances(clip, system, cmdr, distances):
return True


def get_standard_stars():
testStars = set()
if 'TEST' in os.environ:
try:
with open("data/test-stars.txt", "rU") as fh:
for line in fh:
text = line.strip()
if text.startswith(';'):
continue
if text.startswith('#'):
continue
testStars.add(text)
except FileNotFoundError:
pass
if testStars:
return list(testStars)
return standardStars


############################################################################

def main():
Expand Down Expand Up @@ -372,6 +391,7 @@ def main():
These are stars with well-known positions.
===================================================
""")
standardStars = get_standard_stars()
distances, term = get_distances(clip, list(), standardStars)

print("""
Expand Down

0 comments on commit bed80eb

Please sign in to comment.