Hi,

2014/1/13 Gustavo Carneiro <[email protected]>:
> Here you can find a small module I made to monkey-patch some of the Ghost.py
> methods to make them cooperative with Tulip:
>
> http://pastebin.com/sveXBpjK
>
> Maybe it will be useful to someone else.
>
> Ghost.py is a python module that implements a headless web browser, using
> Qt4: https://pypi.python.org/pypi/Ghost.py

When I read "Qt" I expect that you use Qt event loop in Tulip, but
your monkey-patch is only a partial patch to use Tulip for some
functions.

I see that you use polling in wait_for() (with sleep of 10 ms).
Polling is inefficient. You should try to use a future and wait for
the future completion instead. For example, wait_for_page_loaded()
would complete the future when the page is loaded. The problem is to
see how to patch Ghost to call a method when loaded attribute value
changes :-)

Victor

Reply via email to