def launch_service(): """Check if IQFeed.exe is running and start if not""" svc = iq.FeedService(product=dtn_product_id, version="Debugging", login=dtn_login, password=dtn_password)
def launch_service(): """Check if IQFeed.exe is running and start if not""" dtn_product_id, dtn_login, dtn_password, version = dtn_credentials() svc = iq.FeedService(product=dtn_product_id, version=version, login=dtn_login, password=dtn_password) headless = bool(os.environ["DTN_HEADLESS"]) if "DTN_HEADLESS" in os.environ else "DISPLAY" not in os.environ logging.getLogger(__name__).info("Launching IQFeed service in " + ("headless mode" if headless else "non headless mode")) svc.launch(headless=headless)
def launch_service(): """Check if IQFeed.exe is running and start if not""" svc = iq.FeedService(product=dtn_product_id, version="Debugging", login=dtn_login, password=dtn_password) # svc.launch(headless=False) # If you are running headless comment out the line above and uncomment # the line below instead. This runs IQFeed.exe using the xvfb X Framebuffer # server since IQFeed.exe runs under wine and always wants to create a GUI # window. svc.launch(headless=True)
if __name__ == "__main__": parser = argparse.ArgumentParser(description="Launch IQFeed.") parser.add_argument('--nohup', action='store_true', dest='nohup', default=False, help="Don't kill IQFeed.exe when this script exists.") parser.add_argument('--headless', action="store_true", dest='headless', default=False, help="Launch IQFeed in a headless XServer.") parser.add_argument('--control_file', action='store', dest='ctrl_file', default="/tmp/stop_iqfeed.ctrl", help='Stop running if this file exists.') arguments = parser.parse_args() IQ_FEED = iq.FeedService(product=dtn_product_id, version="IQFEED_LAUNCHER", login=dtn_login, password=dtn_password) nohup = arguments.nohup headless = arguments.headless ctrl_file = arguments.ctrl_file IQ_FEED.launch(timeout=30, check_conn=True, headless=headless, nohup=nohup) # Modify code below to connect to the socket etc as described above admin = iq.AdminConn(name="Launcher") admin_listener = iq.VerboseAdminListener("Launcher-listen") admin.add_listener(admin_listener) with iq.ConnConnector([admin]) as connected: