=== modified file 'doc/pykhtml.htm' --- doc/pykhtml.htm 2007-04-10 01:22:36 +0000 +++ doc/pykhtml.htm 2007-04-27 17:10:41 +0000 @@ -32,6 +32,8 @@

stopEventLoop()

Stop the event loop and hence exit the scraper.

timer(time, func)

Call the given function after the alloted time. The PyKHTML event loop needs to be checkProcessRunning.

init(display=1, registerExceptionHandler=True, _sleep=1, _stopKWallet=True, _supressQtDebug=True, _stopCookieDialogs=True)

Initiate the system if necessary (start Xvfb if it's not running, connect to it, start our program instance). This is called automatically when you create a Browser instance, so you shouldn't have to worry about it unless you want to set some of the values of the arguments. You can specify use of a certain X display by setting the `display` parameter, and can stop pykhtml registering its exception handler (the excepthook function) by setting `registerExceptionHandler` to False.
+

class EventLoopAlreadyStartedError (inherits Exception)

+

_checkProcessRunningPosix(name)

excepthook(type, value, trace)

Our exception hook that prints out the traceback, powers down the pykhtml engine, and then exits.

pathSearch(name)

Utility function to search for and get the full path of a file in $PATH.
=== modified file 'pykhtml/__init__.py' --- pykhtml/__init__.py 2007-04-16 20:18:57 +0000 +++ pykhtml/__init__.py 2007-04-27 17:10:41 +0000 @@ -208,9 +208,18 @@ kw = kwargs or self.kwargs return self.fun(*(self.pending + args), **kw) + +class EventLoopAlreadyStartedError(Exception): + pass + +eventLoopStarted = False def startEventLoop(): """ Starts the PyKHTML event loop. PyKHTML works with an asynchronous callback mechanism -- a little like Twisted does. Calls to open a new webpage aren't synchronous, as with urllib, for example. """ + global eventLoopStarted + if eventLoopStarted: + raise EventLoopAlreadyStartedError() init() + eventLoopStarted = True application.exec_loop() def stopEventLoop(): === modified file 'tests/test_core.py' --- tests/test_core.py 2007-04-16 20:18:57 +0000 +++ tests/test_core.py 2007-04-27 17:10:41 +0000 @@ -32,6 +32,7 @@ def test_pathSearch(): """ Test that we can find executables in pykhtml.path (populated with $PATH by default) """ # append this directory to pykhtml.path + assert pykhtml.path pykhtml.path.append(here) fileName = os.path.abspath(__file__).rstrip("c") # strip off pyc assert pykhtml.pathSearch("test_core.py") === modified file 'todo.txt' --- todo.txt 2007-04-16 20:18:57 +0000 +++ todo.txt 2007-04-27 17:10:41 +0000 @@ -13,5 +13,4 @@ Bugs: - + When having two calls to startEventLoop/stopEventLoop: exceptions.RuntimeError: underlying C/C++ object has been deleted - +I'm sure they exist, just can't see any at the moment ;-)