1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- from app.app_config import PROJECT_CONFIG, SPEAKER_CONFIG_FILE, LINPHONE_CONFIG_FILE, VLC_DEBUG_LEVEL, VLC_BUF_LEN
- import configparser
- import sys
- from app.log import Logger
- """
- desc:
- 日志实例初始化
-
- Parameters:
-
- Returns:
- 返回日志一个日志实例
- """
- log = Logger()
- """
- desc:
- 配置解析器
- """
- app_enanle_cf = configparser.ConfigParser()
- app_enanle_cf.read(SPEAKER_CONFIG_FILE)
- """
- desc:
- 启动开关读取
- """
- app_enanle = app_enanle_cf.get("system", "broadcast_service")
- if app_enanle != 'yes':
- log.logger.warning("Broadcast service is disbaled!")
- sys.exit(0)
- project_cf = configparser.ConfigParser()
- project_cf.read(PROJECT_CONFIG)
- speaker_cf = configparser.ConfigParser()
- linphone_cf = configparser.ConfigParser()
- from app.player import Player
- """
- desc:
- 实例化播放器
-
- Parameters:
- param1 - 指定音频设备(只有x10需要)
-
- Returns:
- 一个播放器实例
- """
- player = Player()
- """
- desc:
- 配置实例初始化
-
- Returns:
- 一个配置实例
- """
- from app.config import Config
- config = Config()
- """
- desc:
- mqtt指令函数注册实例初始化
-
- Returns:
- 一个注册实例
- """
- from app.register import Register
- register = Register()
- """
- desc:
- 项目注册功能类实例化
-
- Returns:
- 一个设备实例
- """
- from app.device import Device
- device = Device()
- from app import views
|