def load_col_type_mapper(): global col_type_mapper tbls = get_tables() for tbl in tbls: for col in tbl.columns: typ = type(col.type) if json_to_obj.get(typ): col_type_mapper[(tbl.name, col.name)] = json_to_obj.get(typ)
def load_col_type_mapper(): global col_type_mapper tbls = get_tables() for tbl in tbls: for col in tbl.columns: typ = type(col.type) if json_to_obj.get(typ): col_type_mapper[(tbl.name,col.name)] = json_to_obj.get(typ)
def prep(dbms="sqlite:///snoopy.db"): global db global tables global metadata db=create_engine(dbms) db.debug=True create_tables(db) tables = get_tables() metadata = MetaData(db) metadata.reflect()
def prep(dbms="sqlite:///snoopy.db"): global db global tables global metadata db = create_engine(dbms) db.debug = True create_tables(db) tables = get_tables() metadata = MetaData(db) metadata.reflect()
def run_webserver(port=9001,ip="0.0.0.0",_db=None): #create_db_tables() global db global tables global metadata db = _db if not _db: dbms="sqlite:///snoopy.db" db=create_engine(dbms) tables = get_tables() metadata = MetaData(db) app.run(host=ip, port=port)
def run_webserver(port=9001,ip="0.0.0.0",cert=None,key=None,_db=None): #create_db_tables() global db global tables global metadata db = _db if not _db: dbms="sqlite:///snoopy.db" db=create_engine(dbms) tables = get_tables() metadata = MetaData(db) ssl_context=None if cert and key: ssl_context=SSL.Context(SSL.TLSv1_2_METHOD) ssl_context.use_privatekey_file(key) ssl_context.use_certificate_file(cert) app.run(host=ip, port=port, ssl_context=ssl_context)
def run_webserver(port=9001, ip="0.0.0.0", cert=None, key=None, _db=None): #create_db_tables() global db global tables global metadata db = _db if not _db: dbms = "sqlite:///snoopy.db" db = create_engine(dbms) tables = get_tables() metadata = MetaData(db) ssl_context = None if cert and key: ssl_context = SSL.Context(SSL.TLSv1_2_METHOD) ssl_context.use_privatekey_file(key) ssl_context.use_certificate_file(cert) app.run(host=ip, port=port, ssl_context=ssl_context)