#!/usr/bin/env python3

with open('colorlight_pins.txt', 'r') as f:
    pins = []
    for line in f.readlines():
        cells = line.split('|')
        cells = [cell.strip() for cell in cells]
        cells.pop(0)

        pins.append((int(cells[1]), cells[0]))
        pins.append((int(cells[2]), cells[3]))

    out = ""
    for i, pin in enumerate(pins):
        position = i * -2.54
        out += f"""(pin input line (at 0 {position:.2f} 0) (length 2.54)
  (name "{pin[1]}" (effects (font (size 1.27 1.27))))
  (number "{pin[0]}" (effects (font (size 1.27 1.27))))
)
"""
        
        
    print(out)

