123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- 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("--aout=alsa")
- """
- 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
|