Python | 5 Oct 2011 15:44
Picon
Favicon

Want to crontribute

I'm wondering if the source code for twill is available in a public repository. I'm thinking I could contribute to the project, but not sure if it's the best thing just to submit patches. I'd be interested for instance in porting the application to Python 3 and adding a couple of new features for which I had to use workarounds.

If development has been frozen we could create a fork if the license allows, given the last release was performed almost 4 years ago, asit would be a pity to let such a good project die.
   
_______________________________________________
twill mailing list
twill@...
http://lists.idyll.org/listinfo/twill
C. Titus Brown | 5 Oct 2011 15:49
Picon
Favicon

Re: Want to crontribute

github.com/ctb/twill/.  Go to town :).

cheers,
--titus

On Wed, Oct 05, 2011 at 06:44:45AM -0700, Python wrote:
> I'm wondering if the source code for twill is available in a public repository. I'm thinking I could
contribute to the project, but not sure if it's the best thing just to submit patches. I'd be interested for
instance in porting the application to Python 3 and adding a couple of new features for which I had to use workarounds.
> 
> If development has been frozen we could create a fork if the license allows, given the last release was
performed almost 4 years ago, asit would be a pity to let such a good project die.
> _______________________________________________
> twill mailing list
> twill@...
> http://lists.idyll.org/listinfo/twill

--

-- 
C. Titus Brown, ctb@...
Picon
Gravatar

Re: Want to crontribute

On Wed, Oct 5, 2011 at 10:49 AM, C. Titus Brown <ctb@...> wrote:
> github.com/ctb/twill/.  Go to town :).

How sad, I was really having fun wit the Darcs repo... :) No problem,
however, I bet it will be more accessible now.

--

-- 
Adam Victor Nazareth Brandizzi
http://brandizzi.googlepages.com/
Jonathan Rogers | 5 Oct 2011 21:49

meta http-equiv refresh content syntax

I have removed Twill's ancient copy of mechanize and made it work with a
regular, current distribution. One test currently fails because of a
disagreement about how to interpret the content attribute of a meta
http-equiv="refresh" element:

<meta http-equiv="refresh" content="0;'URL=/login'">

The test script (test-equiv-refresh.twill) expects the above to cause a
load of "/login". It seems that's what the ancient internal version of
mechanize did, but a current version tries to load "URL=/login" which
results in a 404. This is exactly the same behavior I get in Firefox,
Chromium, and Epiphany.

If the test is correct and typical browsers are not, what's the real
authority? I'm having trouble even finding a formal definition of the
syntax the content attribute is supposed to have.

--

-- 
Jonathan Ross Rogers
Stephen McInerney | 5 Oct 2011 21:55
Picon
Favicon

Re: meta http-equiv refresh content syntax

Excellent work Jonathan.

Stephen

> Date: Wed, 5 Oct 2011 15:49:28 -0400
> From: jrogers-+z4E91SeU6Qg+LkckTzjXg@public.gmane.org
> To: twill-zFNWeKVCUJJD5a/XDn3G2A@public.gmane.org
> Subject: [twill] meta http-equiv refresh content syntax
>
> I have removed Twill's ancient copy of mechanize and made it work with a
> regular, current distribution. One test currently fails because of a
> disagreement about how to interpret the content attribute of a meta
> http-equiv="refresh" element:
>
> <meta http-equiv="refresh" content="0;'URL=/login'">
>
> The test script (test-equiv-refresh.twill) expects the above to cause a
> load of "/login". It seems that's what the ancient internal version of
> mechanize did, but a current version tries to load "URL=/login" which
> results in a 404. This is exactly the same behavior I get in Firefox,
> Chromium, and Epiphany.
>
> If the test is correct and typical browsers are not, what's the real
> authority? I'm having trouble even finding a formal definition of the
> syntax the content attribute is supposed to have.
>
> --
> Jonathan Ross Rogers
>
> _______________________________________________
> twill mailing list
> twill-zFNWeKVCUJI@public.gmane.orgyll.org
> http://lists.idyll.org/listinfo/twill
_______________________________________________
twill mailing list
twill@...
http://lists.idyll.org/listinfo/twill
Jonathan Rogers | 6 Oct 2011 00:12

Re: meta http-equiv refresh content syntax

Leon Robbins wrote:
> Why is
>
> URL=/login
>
> bounded by single quotes? The examples on this Wikipedia page omit them:

That's exactly what I've been trying to figure out. The HTML in question
is in "tests/twilltestserver.py". TwillTest.test_refresh3() in that
module has the single-quoted value. Test script
"tests/test-equiv-refresh.twill" expects that value to cause Twill to
reload "/login". It seems that's what it did using the old, internal
version of mechanize.

Using a current version of mechanize, no reload occurs. Normal browsers
like Firefox and Chromium try to reload "/URL=/login" itself as a URL,
which is a non-existent page. I haven't been able to find a clear
specification for the format of the content attribute of the meta
element. It's doesn't seem to be specified in either HTML or HTTP and I
suspect it's just supposed to work how Netscape implemented it. Since
Firefox is a current Mozilla browser, it may be the most authoritative.

>
> http://en.wikipedia.org/wiki/Meta_refresh
>
> What happens if you leave them out too?
>

Without the single quotes, everything works as expected. That's what
TwillTest.test_refresh2() does.

--

-- 
Jonathan Ross Rogers
Jonathan Rogers | 6 Oct 2011 00:18

Re: Syntax warning when installing twill

Christoph Zwerschke wrote:
> When installing twill, I get a syntax warning about the following
> statement in twill/other_packages/_mechanize_dist/_msiecookiejar.py:
> 
>                 assert (sig in ("HASH", "LEAK",
>                                 self.padding, "\x00\x00\x00\x00"),
>                         "unrecognized MSIE index.dat record: %s" %
>                         binary_to_str(sig))
> 
> The comma at the beginning of the first line should in fact be at the
> end of the second line:
> 
>                 assert sig in ("HASH", "LEAK",
>                                 self.padding, "\x00\x00\x00\x00"), (
>                         "unrecognized MSIE index.dat record: %s" %
>                         binary_to_str(sig))

That bug is in the ancient version of mechanize included with Twill. I
have ripped that out and made Twill work with a standard, current
version of mechanize. Please try out my branch and see if it works for you:

<URL:https://github.com/JonathanRRogers/twill>

--

-- 
Jonathan Ross Rogers
Jonathan Rogers | 6 Oct 2011 00:21

Re: Want to crontribute

C. Titus Brown wrote:
> github.com/ctb/twill/.  Go to town :).
> 

Please have a look at my branch which addresses several issues I've had
using it with current versions of mechanize and wsgi_intercept:

<URL:https://github.com/JonathanRRogers/twill>
--

-- 
Jonathan Ross Rogers
Picon
Gravatar

[RFC] Use of non-string values with ${} notation

Hello, all!

consider the following twill script:

    run 'value = 123'
    go http://www.google.com
    fv 1 q ${value}
    submit
    code 200

If I run this script, I get this error:

    AT LINE: test.twill:3
    ** UNHANDLED EXCEPTION: cannot concatenate 'str' and 'int' objects

The solution is simple: just call str() on the value:

    fv 1 q ${str(value)}

(I could quote the value when setting it, too, but It is not always
possible or desirable)

However, I get into this situation a lot of times and find it pretty
annoying. I wonder: does anyone here get in this situation too? I have
patched twill to stringify all values; would this change be desirable
for everyone?

Thanks in advance!

--

-- 
Adam Victor Nazareth Brandizzi
http://brandizzi.googlepages.com/

Gmane