Skip to content

Commit

Permalink
replay_to_html can be called programmatically
Browse files Browse the repository at this point in the history
  • Loading branch information
fj128 committed Jun 19, 2011
1 parent 834c9db commit bec49de
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
25 changes: 17 additions & 8 deletions ltg/src/fj_scratch/test.py
Expand Up @@ -9,12 +9,21 @@
#res = eval_sequence(seq, debug = True)
#pprint(res)

from terms import parse_lambda, binarize_term, term_to_sequence
#from terms import parse_lambda, binarize_term, term_to_sequence
#
#l = r'(\x.(attack x))'
#t = parse_lambda(l)
#print t
#t = binarize_term(t)
#print t
#s = term_to_sequence(t)
#print s

import play
import replay_to_html
import shlex
import webbrowser

l = r'(\x.(attack x))'
t = parse_lambda(l)
print t
t = binarize_term(t)
print t
s = term_to_sequence(t)
print s
#play.main(*shlex.split('--replay battery.rpl the_battery_bot() IdleBot()'))
#replay_to_html.main('battery.rpl')
webbrowser.open('battery.html')
13 changes: 7 additions & 6 deletions ltg/src/replay_to_html.py
Expand Up @@ -8,12 +8,7 @@
HEAD = 3300 # how many head and tail moves we show
TAIL = 20

if __name__ == '__main__':
if len(sys.argv) != 2:
print 'usage: replay_to_html hz.rpl'
exit(1)

replay_name = sys.argv[1]
def main(replay_name):
with open(replay_name) as fin:
replay = list(fin)

Expand Down Expand Up @@ -99,3 +94,9 @@
print>>html, '</div></body></html>'
html.close()
sys.stdout = original_stdout

if __name__ == '__main__':
if len(sys.argv) != 2:
print 'usage: replay_to_html hz.rpl'
exit(1)
main(sys.argv[1])

0 comments on commit bec49de

Please sign in to comment.