本文整理汇总了Python中Output.notice方法的典型用法代码示例。如果您正苦于以下问题:Python Output.notice方法的具体用法?Python Output.notice怎么用?Python Output.notice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Output
的用法示例。
在下文中一共展示了Output.notice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: find
# 需要导入模块: import Output [as 别名]
# 或者: from Output import notice [as 别名]
def find():
"""Returns the USB port address of the camera."""
global __path
Output.debug("In USBDevice.find()")
if Settings.SIMULATE_USB_DEVICE:
__path = "/dev/bus/usb/042/023"
Output.debug("Simulation! Pretending the device is " + __path + ".")
return __path
result = subprocess.Popen("gphoto2 --auto-detect", stdout=subprocess.PIPE, shell=True).stdout.read()
Output.debug("Result of `gphoto2 --auto-detect`: " + result)
match = re.compile("(?P<camera>[^\n]+?) +usb:(?P<device>[0-9]{3}),(?P<port>[0-9]{3})",re.MULTILINE).search(result)
if match != None:
Output.notice("Found camera: " + match.group('camera') + " on USB port " + match.group('device') + "," + match.group('port'))
__path = "/dev/bus/usb/" + match.group('device') + "/" + match.group('port')
Output.notice("Path is now: " + __path)
return __path
raise "Camera not found. Connect it to the Pi, switch it on and verify that `gphoto2 --auto-detect` finds it."