Part of lp.services.googlesearch
Class | GoogleRequestHandler | Return an XML file depending on the requested URL. |
Function | url_to_xml_map | Return our URL-to-XML mapping as a dictionary. |
Function | get_service_endpoint | Return the host and port that the service is running on. |
Function | service_is_available | Return True if the service is up and running. |
Function | wait_for_service | Poll the service and BLOCK until we can connect to it. |
Function | wait_for_service_shutdown | Poll the service until it shuts down. |
Function | hostpair | Parse the host and port number out of a URL string. |
Function | start_as_process | Run this file as a stand-alone Python script. |
Function | kill_running_process | Find and kill any running web service processes. |
Function | safe_unlink | Unlink a file, but don't raise an error if the file is missing. |
Function | main | Run the HTTP server. |
Parameters | timeout | BLOCK execution for at most 'timeout' seconds before returning False. |
Parameters | timeout | The socket should timeout after this many seconds. Refer to the socket module documentation in the Standard Library for possible timeout values. |
Raises a RuntimeError if the service doesn't shut down within the allotted time, under normal operation. It may also raise various socket errors if there are issues connecting to the service (host lookup, etc.)
Parameters | seconds_to_wait | The number of seconds to wait for the socket to open up. |