You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

airportStream.py 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. # -*- coding: utf-8 -*-
  2. from multiprocessing import freeze_support
  3. from os.path import dirname, realpath, join
  4. from loguru import logger
  5. from service.MqttDisService import MqttDispatcherService
  6. from service.HttpDisService import HttpDispatcherService
  7. from util.LogUtils import init_log
  8. from util.RWUtils import getConfigs
  9. '''
  10. 主程序入口
  11. '''
  12. if __name__ == '__main__':
  13. freeze_support()
  14. base_dir = dirname(realpath(__file__))
  15. init_log(base_dir)
  16. logger.info("(♥◠‿◠)ノ゙ 【机场推流服务】开始启动 ლ(´ڡ`ლ)゙")
  17. print("(♥◠‿◠)ノ゙ 【机场推流服务】开始启动 ლ(´ڡ`ლ)゙")
  18. print("############################################################")
  19. print("配置文件路径: ", join(base_dir, "config"))
  20. print("服务配置文件: service.yml")
  21. print("mqtt配置文件: mqtt.yml")
  22. print("日志配置文件: logger.yml")
  23. print("日志文件路径: ", join(base_dir, "logs"))
  24. print("############################################################")
  25. # mqtt交互
  26. service_config = getConfigs(base_dir, "config/service.yml")
  27. service_config['base_dir'] = base_dir
  28. if 1 == service_config['docking_method']:
  29. print("当前使用的交互模式是mqtt交互!!")
  30. print("############################################################")
  31. MqttDispatcherService(service_config)
  32. elif 2 == service_config['docking_method']:
  33. print("当前使用的交互模式是接口交互!!")
  34. print("############################################################")
  35. HttpDispatcherService(service_config)