[twill] using extend_with modules in python script?

Michael mike23w at yahoo.com
Mon Jun 26 14:28:38 PDT 2006


Hi,

I'm new to twill. It's really cool.

I was wondering if something like this could be added (or maybe it's already
there?):

#extendtwill.py
    from twill import commands
    def find_link(regex):
        link = commands.get_browser().find_link(regex)
        return link


#twilltest.py:
    import twill
    import re
    twill.commands.extend_with('extendtwill')
    # [code to get some web page...]
    twill.commands.find_link(re.compile('foo')) # ERROR!

Where extend_with() would make extension functions (like find_link())
available in the twill.commands namespace.

Thanks, Mike



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the twill mailing list