bartneck / swiML

A project to formalise swimming programs using XML
MIT License
2 stars 2 forks source link

Multiple equipments in swiML.py do not work #87

Closed bartneck closed 4 months ago

bartneck commented 4 months ago

Only pads in equipment:

threeSet=swiML.Repetition(
    repetitionCount=3,
    instructions=[
        swiML.Instruction(
            length=('lengthAsDistance',200),
            stroke=('standardStroke','freestyle'),
            rest=('sinceStart','PT3M10S'),
            equipment=('pads')
        )
    ]
)

Results in:

<instruction>
        <repetition>
            <repetitionCount>3</repetitionCount>
            <simplify>false</simplify>
            <instruction>
                <length>
                    <lengthAsDistance>200</lengthAsDistance>
                </length>
                <stroke>
                    <standardStroke>freestyle</standardStroke>
                </stroke>
                <rest>
                    <sinceStart>PT3M10S</sinceStart>
                </rest>
                <equipment>pads</equipment>
            </instruction>
        </repetition>
    </instruction>

Adding, pads and pullboy:

threeSet=swiML.Repetition(
    repetitionCount=3,
    instructions=[
        swiML.Instruction(
            length=('lengthAsDistance',200),
            stroke=('standardStroke','freestyle'),
            rest=('sinceStart','PT3M10S'),
            equipment=('pads','pullBuoy')
        )
    ]
)

results in no equipment:

<instruction>
        <repetition>
            <repetitionCount>3</repetitionCount>
            <simplify>false</simplify>
            <instruction>
                <length>
                    <lengthAsDistance>200</lengthAsDistance>
                </length>
                <stroke>
                    <standardStroke>freestyle</standardStroke>
                </stroke>
                <rest>
                    <sinceStart>PT3M10S</sinceStart>
                </rest>
            </instruction>
        </repetition>
    </instruction>

When adding two equipment:

threeSet=swiML.Repetition(
    repetitionCount=3,
    instructions=[
        swiML.Instruction(
            length=('lengthAsDistance',200),
            stroke=('standardStroke','freestyle'),
            rest=('sinceStart','PT3M10S'),
            equipment=('pads'),
            equipment=('pullBuoy')
        )
    ]
)

I get an error message: SyntaxError: keyword argument repeated: equipment

bartneck commented 4 months ago

Tested and okay.