-
Notifications
You must be signed in to change notification settings - Fork 20
/
curses_main.py
executable file
·36 lines (31 loc) · 1.32 KB
/
curses_main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env python3
import argparse
import curses
import logging
from copycat import Copycat
from copycat.curses_reporter import CursesReporter
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO, format='%(message)s', filename='./copycat.log', filemode='w')
parser = argparse.ArgumentParser()
parser.add_argument('--focus-on-slipnet', action='store_true', help='Show the slipnet and coderack, instead of the workspace.')
parser.add_argument('--fps', type=float, default=None, help='Aim for this many frames per second.')
parser.add_argument('--seed', type=int, default=None, help='Provide a deterministic seed for the RNG.')
parser.add_argument('initial', type=str, help='A...')
parser.add_argument('modified', type=str, help='...is to B...')
parser.add_argument('target', type=str, help='...as C is to... what?')
options = parser.parse_args()
try:
window = curses.initscr()
copycat = Copycat(
reporter=CursesReporter(
window,
focus_on_slipnet=options.focus_on_slipnet,
fps_goal=options.fps,
),
rng_seed=options.seed,
)
copycat.run_forever(options.initial, options.modified, options.target)
except KeyboardInterrupt:
pass
finally:
curses.endwin()