예제 #1
0
파일: couchdb.py 프로젝트: gr2m/gbi-client
 def run(self):
     erl_cmd = self.app_state.config.get('couchdb', 'erl_cmd')
     bin_dir = self.app_state.config.get('couchdb', 'bin_dir')
     self.db = CouchDBProcess('127.0.0.1', self.port, self.db_path, erl_cmd, bin_dir)
     with self.db:
         wait_for_http_server('127.0.0.1', self.port)
         time.sleep(3)
         yield
예제 #2
0
파일: couchdb.py 프로젝트: kaiCu/gbi-client
 def run(self):
     erl_cmd = self.app_state.config.get('couchdb', 'erl_cmd')
     bin_dir = self.app_state.config.get('couchdb', 'bin_dir')
     self.db = CouchDBProcess('127.0.0.1', self.port, self.db_path, erl_cmd,
                              bin_dir)
     with self.db:
         wait_for_http_server('127.0.0.1', self.port)
         time.sleep(3)
         yield
예제 #3
0
 def run(self):
     erl_cmd = self.app_state.config.get("couchdb", "erl_cmd")
     bin_dir = self.app_state.config.get("couchdb", "bin_dir")
     log_file = os.path.join(self.app_state.user_data_path("log", make_dirs=True), "couchdb_tmp.log")
     self.db = CouchDBProcess("127.0.0.1", self.port, self.db_path, erl_cmd, bin_dir, log_file)
     with self.db:
         wait_for_http_server("127.0.0.1", self.port)
         time.sleep(3)
         yield
예제 #4
0
 def run(self):
     erl_cmd = self.app_state.config.get('couchdb', 'erl_cmd')
     bin_dir = self.app_state.config.get('couchdb', 'bin_dir')
     log_file = os.path.join(
         self.app_state.user_data_path('log', make_dirs=True),
         'couchdb_tmp.log'
     )
     self.db = CouchDBProcess('127.0.0.1', self.port, self.db_path, erl_cmd, bin_dir, log_file)
     with self.db:
         wait_for_http_server('127.0.0.1', self.port)
         time.sleep(3)
         yield
예제 #5
0
def mapproxy_thread(app_state):
    """Mapproxy background thread"""
    from mapproxy.wsgiapp import make_wsgi_app
    from geobox.lib.webserver import WebServerThread
    from geobox.utils import wait_for_http_server

    host = app_state.config.get('app', 'host')
    mapproxy_port = app_state.config.get('mapproxy', 'port')
    couch_port = app_state.config.get_int('couchdb', 'port')
    user_dir = app_state.user_data_path()

    # wait for up to ten seconds till couchdb is online
    wait_for_http_server('127.0.0.1', couch_port, max_wait=10)

    from geobox.lib.mapproxy import write_mapproxy_config
    write_mapproxy_config(app_state)

    app = make_wsgi_app(os.path.join(user_dir, 'mapproxy.yaml'), reloader=True)
    return WebServerThread(host, mapproxy_port, app, logger_name='geobox.mapproxy.server')
예제 #6
0
파일: app.py 프로젝트: GeoDodo/gbi-client
def mapproxy_thread(app_state):
    """Mapproxy background thread"""
    from mapproxy.wsgiapp import make_wsgi_app
    from geobox.lib.webserver import WebServerThread
    from geobox.utils import wait_for_http_server

    host = app_state.config.get('app', 'host')
    mapproxy_port = app_state.config.get('mapproxy', 'port')
    couch_port = app_state.config.get_int('couchdb', 'port')
    user_dir = app_state.user_data_path()

    # wait for up to ten seconds till couchdb is online
    wait_for_http_server('127.0.0.1', couch_port, max_wait=10)

    from geobox.lib.mapproxy import write_mapproxy_config
    write_mapproxy_config(app_state)

    app = make_wsgi_app(os.path.join(user_dir, 'mapproxy.yaml'), reloader=True)
    return WebServerThread(host, mapproxy_port, app, logger_name='geobox.mapproxy.server')
예제 #7
0
 def _open():
     wait_for_http_server(host, port)
     webbrowser.open('http://%s:%d' % (host, port))
예제 #8
0
파일: app.py 프로젝트: omniscale/gbi-client
 def _open():
     wait_for_http_server(host, port)
     webbrowser.open("http://%s:%d" % (host, port))