ctb / twill-legacy

A simple command-line Web browser, for testing and Web automation.
https://twill-tools.github.io/twill
58 stars 29 forks source link

Now any value, not only strings, can be used through ${} notation #2

Closed brandizzi closed 10 years ago

brandizzi commented 12 years ago

The ${} notation requres a string value. One cannot do something like:

run 'counter = 0'
find "This is visit no. ${counter}"

and should use something like this:

run 'counter = 0'
find "This is visit no. ${str(counter)}"

I find it unnecessary and annoying, so I am submitting a patch for a different behavior. The testes I've added (tests/test-dollar-sign-notation.*) shows the difference in behavior.

brandizzi commented 12 years ago

I extended the original change for allowing use ${} notation on non strings also in echo and fv parameters. Also, I solved some problems with isinstance() comparing values to str instead of basestring. Do you find it interesting or believe it should not be applied to twill?