#!/usr/bin/env python
import sys
import os
import optparse
import textwrap
import mpslogic
import subprocessca_R1_0_4 as subprocessca



def main(argv):

    states = [int(s) for s in subprocessca.get('IOC:BSY0:MP01:TTBLST.VALA').split()[1:]]
    

    keys = ('config', 'logic')
    args = dict(zip(keys, argv))

    print states

    print states[323]
    
    sys.exit(0)
    

    logic = mpslogic.Logic(path=options.mpl_path)
    logic.revision = options.latex_rev

    if options.export_code:
        if options.code_path is not sys.stdout:
            with open(options.code_path, 'w') as f:
                logic.export_c_code(f)
        else:
            logic.export_c_code()

    if options.export_latex:
        if options.latex_path is not sys.stdout:
            with open(options.latex_path, 'w') as f:
                logic.export_latex(f)
        else:
            logic.export_latex()

    if options.export_rst:
        if options.rst_path is not sys.stdout:
            with open(options.rst_path, 'w') as f:
                logic.export_rst(f)
        else:
            logic.export_rst()
        
    return 0


if __name__ == '__main__':
    status = main(sys.argv[1:])
    sys.exit(status)

