sys.path.append("Server/src") import global_settings import dbinfo if __name__ == '__main__': from pyticas import ticas from pyticas.infra import Infra from pyticas_tetres.db.cad import conn as conn_cad from pyticas_tetres.db.iris import conn as conn_iris from pyticas_tetres.db.tetres import conn ticas.initialize(global_settings.DATA_PATH) infra = Infra.get_infra() conn.connect(dbinfo.tetres_db_info()) conn_cad.connect(dbinfo.cad_db_info()) conn_iris.connect(dbinfo.iris_incident_db_info()) time.sleep(1) print('') print( '!! Do not run multiple instances of this program. (DB sync problem can be caused in bulk-insertion and deletion)') print('!! Stop TeTRES Server if it is running.') print('') print('# loads weather data for the given time period') print('') sdt_str = input('# Enter start date to load data (e.g. 2015-01-01) : ') sdate = datetime.datetime.strptime(sdt_str, '%Y-%m-%d').date()
from pyticas import tetresconf def read_host_ip(): """ read server host ip from `tetres.conf` file :rtype: str """ return tetresconf.get_property('ticas.python_server_host_ip') if __name__ == '__main__': port = 5000 TeTRES_DB_INFO = dbinfo.tetres_db_info() CAD_DB_INFO = dbinfo.cad_db_info() IRIS_DB_INFO = dbinfo.iris_incident_db_info() if tetresconf.get_property("ticas.download_traffic_data_files").capitalize() is "TRUE": global_settings.DOWNLOAD_TRAFFIC_DATA_FILES = True else: global_settings.DOWNLOAD_TRAFFIC_DATA_FILES = False print(f"DOWNLOAD_TRAFFIC_DATA_FILES: {global_settings.DOWNLOAD_TRAFFIC_DATA_FILES}") print('DATA PATH : ', global_settings.DATA_PATH) from colorama import init as initialize_colorama initialize_colorama(autoreset=True) # import required modules from pyticas_server.server import TICASServer