def run_server(doc_root): ObjectDb.audio_utils = media_utils.AudioUtils() httpd_server = mozhttpd.MozHttpd( port=16932, docroot=doc_root, urlhandlers=[ {'method': 'GET', 'path': '/audio/', 'function': parseGETUrl}, {'method': 'GET', 'path': '/server/?', 'function': parseGETUrl} ] ) logging.info("Server %s at %s:%s", httpd_server.docroot, httpd_server.host, httpd_server.port) ObjectDb.httpd_server = httpd_server httpd_server.start() return httpd_server
parser.add_option( "-b", "--browser", dest="browser", help="Firefox Browser Exeuctable Path", ) parser.add_option( "-t", "--talos", dest="talos_path", help="Talos Path to serves as docroot", ) parser.add_option( "-r", "--results_url", dest="talos_results", help="Talos Results Url", ) (options, args) = parser.parse_args() ObjectDb.talos_results_url = options.talos_results # 1. Create handle to the AudioUtils ObjectDb.audio_utils = media_utils.AudioUtils() # 2. Kick off the browser open_browser(options.browser, options.profile) # 3. Start the httpd server run_server(options.talos_path)