本文整理汇总了Python中HardwareRepository.HardwareRepository.connect方法的典型用法代码示例。如果您正苦于以下问题:Python HardwareRepository.connect方法的具体用法?Python HardwareRepository.connect怎么用?Python HardwareRepository.connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HardwareRepository.HardwareRepository
的用法示例。
在下文中一共展示了HardwareRepository.connect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setLogFile
# 需要导入模块: from HardwareRepository import HardwareRepository [as 别名]
# 或者: from HardwareRepository.HardwareRepository import connect [as 别名]
# this line important for socketio msg, otherwise no msg is sent...
socketio.init_app(app)
# the following test prevents Flask from initializing twice
# (because of the Reloader)
if not app.debug or os.environ.get("WERKZEUG_RUN_MAIN") == "true":
###Initialization of the HardwareObjects
# this is to allow Hardware Objects to do
# 'from HardwareRepository import ...'
sys.path.insert(0, os.path.dirname(__file__))
from HardwareRepository import HardwareRepository as hwr, setLogFile
hwr.addHardwareObjectsDirs([os.path.join(os.path.dirname(__file__), 'HardwareObjects')])
hwr_directory = cmdline_options.hwr_directory
hwr = hwr.HardwareRepository(os.path.abspath(os.path.expanduser(hwr_directory)))
hwr.connect()
log_file = cmdline_options.log_file
if log_file:
setLogFile(log_file)
# installs logging handler to send messages to clients
import logging_handler
root_logger = logging.getLogger()
root_logger.setLevel(logging.DEBUG)
custom_log_handler = logging_handler.MX3LoggingHandler()
custom_log_handler.setLevel(logging.DEBUG)
root_logger.addHandler(custom_log_handler)
hwr_logger = logging.getLogger("HWR")
user_logger = logging.getLogger("user_level_log")
queue_logger = logging.getLogger("queue_exec")
# hwr_logger.addHandler(custom_log_handler)