def __init__(self, config): try: from elastichq import create_app self._app = create_app(env='test') self.app = self._app.test_client() self.config = config self.indices_definitions = self.get_index_definitions() except Exception as e: raise e
def __init__(self, config): try: from elastichq import create_app self._app = create_app(env='test') self.app = self._app.test_client() self.config = config self.indices_definitions = self.get_index_definitions() self.clear_indices() self.clear_aliases() self.create_indices() self.create_aliases() self.refresh() except Exception as e: raise e
def run(self): app = create_app() db.drop_all(app=app)
import os import logging import logging.config from elastichq import create_app from elastichq.globals import socketio from elastichq.utils import find_config default_host = '0.0.0.0' default_port = 5000 default_debug = False default_enable_ssl = False default_ca_certs = None default_url = 'http://localhost:9200' is_gunicorn = "gunicorn" in os.environ.get("SERVER_SOFTWARE", "") application = create_app() if __name__ == '__main__': # Set up the command-line options parser = optparse.OptionParser() parser.add_option("-H", "--host", help="Hostname of the Flask app " + \ "[default %s]" % default_host, default=default_host) parser.add_option("-P", "--port", help="Port for the Flask app " + \ "[default %s]" % default_port, default=default_port) parser.add_option("-d", "--debug", action="store_true", dest="debug", default=default_debug, help=optparse.SUPPRESS_HELP)
# import argparse import optparse import os from elastichq import create_app from elastichq.globals import socketio default_host = '0.0.0.0' default_port = 5000 default_debug = False default_url = 'http://localhost:9200' application = create_app() if __name__ == '__main__': # Set up the command-line options parser = optparse.OptionParser() parser.add_option("-H", "--host", help="Hostname of the Flask app " + \ "[default %s]" % default_host, default=default_host) parser.add_option("-P", "--port", help="Port for the Flask app " + \ "[default %s]" % default_port, default=default_port) parser.add_option("-d", "--debug", action="store_true", dest="debug", default=default_debug, help=optparse.SUPPRESS_HELP)