本文整理汇总了Python中util.Util.dotRead方法的典型用法代码示例。如果您正苦于以下问题:Python Util.dotRead方法的具体用法?Python Util.dotRead怎么用?Python Util.dotRead使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类util.Util
的用法示例。
在下文中一共展示了Util.dotRead方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_from_options
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import dotRead [as 别名]
def set_from_options(self, options):
self.camera.hflip = u.dotRead(options, 'hflip', False)
self.camera.vflip = u.dotRead(options, 'vflip', False)
# set supplementary options
self.options = {
"use_video_port": u.dotRead(options, 'use_video_port', False)
}
示例2: capture_image
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import dotRead [as 别名]
def capture_image(self, resize=None, quality=None, use_video_port=None):
stream = io.BytesIO()
# If quality isn't specified, falls back to internal setting.
if quality == None:
quality = self.quality
# If not explicitly defined, revert to default.
if use_video_port == None:
use_video_port = u.dotRead(self.options, 'use_video_port')
self.camera.capture(stream, format='jpeg', resize=resize, quality=quality, use_video_port=use_video_port)
stream.seek(0)
try:
im = Image.open(stream)
buffer = im.load()
im.close()
stream.seek(0)
except Exception as e:
self.logger.error(type(e), e)
return None
return stream, buffer
示例3: get
# 需要导入模块: from util import Util [as 别名]
# 或者: from util.Util import dotRead [as 别名]
def get(self, option=None, default=None):
# a specific option was requested
if option:
return u.dotRead(self.configuration, option, default)
# no option, return the whole configuration
return self.configuration