def config(): """ :return: returns the configuration items in section 'mail' of configuration.ini """ configreader = ConfigReader() params = configreader.get_config("mail") return params
def run_server_process(): print("start run_server_process pid:" + str(os.getpid())) # get config object config = ConfigReader.get_config() # init tcp server tcp_server = TCPServer.TCPServer() # init udp server udp_server = UDPServer.UDPServer() # start event loop event_loop = asyncio.get_event_loop() udp_server.start_server(event_loop) tasks = [tcp_server.start_server()] event_loop.run_until_complete(asyncio.wait(tasks)) try: event_loop.run_forever() except KeyboardInterrupt: pass finally: event_loop.close()
def read_config(config_file): reader = ConfigReader(config_file) return reader.get_config()