Idea for the new page model

1 view
Skip to first unread message

Bernardo Heynemann

unread,
Aug 30, 2010, 5:51:10 PM8/30/10
to pycc...@googlegroups.com
Guys,

While using fabric I was wondering about the following for the new page model:

with('http://www.google.com'):
    xpath('search', 'btnG')
    css('search', 'btnG')

Or something like that.

What do you think?

Cheers,
Bernardo Heynemann

Guilherme Chapiewski

unread,
Aug 31, 2010, 6:11:14 AM8/31/10
to pycc...@googlegroups.com, pycc...@googlegroups.com
The idea is great!

"With" is a reserved keyword from Python 2.6 on, so we just have to find another name :)

We could even stretch this concept and implement pure-text page definitions:

Page "Search Page" with url "http://foobar.com"
    "//h1" as "article title"
    "//p[1]" as "first paragraph"
    ".data" as "chart"

Cheers,
gc
--
Guilherme Chapiewski
(Sent from my iPhone; please excuse typos.)

--
You received this message because you are subscribed to the Google Groups "pyccuracy" group.
To post to this group, send email to pycc...@googlegroups.com.
To unsubscribe from this group, send email to pyccuracy+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyccuracy?hl=en.

Bernardo Heynemann

unread,
Aug 31, 2010, 6:42:05 AM8/31/10
to pycc...@googlegroups.com

I meant for using in python, so with is really with. I do love the idea of a pure text page though.

Enrico

unread,
Aug 31, 2010, 4:47:55 PM8/31/10
to pyccuracy
"With" is great, but maybe it should be something like:

from pyccuracy.context_managers import page
with page('http://www.google.com'):
xpath('search', 'btnG')
css('search', 'btnG')

Best regards,
Enrico

Gabriel Falcão

unread,
Aug 31, 2010, 11:03:18 PM8/31/10
to pycc...@googlegroups.com
Indeed this one looks more pythonic :) 
Best regards,
Enrico

--
You received this message because you are subscribed to the Google Groups "pyccuracy" group.
To post to this group, send email to pycc...@googlegroups.com.
To unsubscribe from this group, send email to pyccuracy+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyccuracy?hl=en.




--
C-x C-c

Att,

Gabriel Falcão

twitter: @gabrielfalcao
my darlings: github.com/gabrielfalcao
jabber: gabrie...@jabber-br.org
blog: http://gabrielfalcao.com

Bernardo Heynemann

unread,
Aug 31, 2010, 11:26:18 PM8/31/10
to pycc...@googlegroups.com
It does indeed.

I think our aim with Pyccuracy from now on will be to make it as pythonic as possible. :)

Thanks for the feedback Enrico and Gabriel.

Cheers,
Bernardo Heynemann

2010/9/1 Gabriel Falcão <gabriel...@gmail.com>
Reply all
Reply to author
Forward
0 new messages