/usr/games/eco2pgn is in scid 1:4.3.0.cvs20120311-1ubuntu3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 37 38 39 40 41 42 43 44 45 46 47 48 49 | #!/usr/bin/env python
#
# eco2pgn
# This file converts the Scid openings classification file (scid.eco)
# and converts it into a PGN file. The main advantage of having it as
# a PGN file is the ability to explore it with the Tree window in Scid.
#
# Usage: eco2pgn scid.eco > scideco.pgn
#
# Contributed by John Wiegley, 2001.08.13
#
import re
import sys
if len(sys.argv) < 2:
sys.stderr.write("usage: eco2pgn file.eco > file.pgn\n")
sys.stderr.write("eco2pgn takes a Scid openings classification file,\n")
sys.stderr.write("and writes it in PGN format to standard output.\n")
sys.exit(1)
fd = open(sys.argv[1], "r")
while 1:
line = fd.readline()
if not line: break
line = line[:-1]
if re.match("\s*(#|$)", line): continue
match = re.match("(\S+)\s+\"([^\"]+)\"(\s+.+)?$", line)
if match:
eco, variation, cont = match.groups()
if not cont:
cont = ''
while not cont or cont[-1] != '*':
cont = cont + ' ' + fd.readline()[:-1]
if cont[-1] == '*' and cont[-2] != ' ':
cont = cont[:-1] + ' *'
print '[ECO "%s"]' % eco
print '[Variation "%s"]' % variation
print '[Result "*"]'
print
print cont
print
|