-
Notifications
You must be signed in to change notification settings - Fork 0
/
zerdax2.py
executable file
·34 lines (28 loc) · 946 Bytes
/
zerdax2.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
#!/usr/bin/python
import sys
import logging as log
import argparse
import algorithm
if __name__ == '__main__':
loglevels = {
'critical': log.CRITICAL,
'error': log.ERROR,
'warning': log.WARNING,
'info': log.INFO,
'debug': log.DEBUG
}
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*')
parser.add_argument('-v', dest='verbose',
default='error', choices=loglevels.keys(),
help='verbosity level')
args = parser.parse_args(sys.argv[1:])
level = loglevels[args.verbose]
log.basicConfig(level=level, format='[%(levelname)s] %(message)s')
for filename in args.filenames:
print(f"============ zerdax2.py {filename} ============", flush=True)
# try:
fen = algorithm.main(filename)
# except Exception:
# continue
print(f"FEN({filename}): {fen}")