def test(n, e, s, expect):
    result = event.statement_spacer(e, spacer=s)
    did_pass = result == expect

    return did_pass, n, 'statement_spacer', str(expect), str(result)
def test(n, e, s, expect):
    result = event.statement_spacer(e, spacer=s)
    did_pass = result == expect

    return did_pass, n, 'statement_spacer', str(expect), str(result)
Пример #3
0
    i 1 + .    0.6 7.00

'''

import re
import sys

from csd.sco import event
from csd.sco import element

from optparse import OptionParser
    
if __name__ == '__main__':
    # Get command-line flags
    u = ['usage: <stdout> |']
    u.append('python s_spacer.py -s[pad amount]')
    usage = ' '.join(u)
    parser = OptionParser(usage)
    parser.add_option("-s", default=1, dest='spacer', help='spacer')
    (options, args) = parser.parse_args()

    options.spacer = int(options.spacer)  # Flag option needs to be an int
    stdin = sys.stdin.readlines()         # Get data from stdin
    sco = []                              # New score lines as list items

    for e in stdin:
        sco.append(event.statement_spacer(e, options.spacer))

    print ''.join(sco),