Skip to content

Commit

Permalink
auto format
Browse files Browse the repository at this point in the history
  • Loading branch information
krisgesling committed Mar 23, 2021
1 parent 3be2901 commit 0b5bb55
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,44 @@
from mycroft import MycroftSkill, intent_handler
from mycroft.util.log import LOG


class CameraSkill(MycroftSkill):
"""
Camera Skill Class
Camera Skill Class
"""

def __init__(self):
super(CameraSkill, self).__init__("CameraSkill")
self.camera_mode = None
self.save_folder = os.path.expanduser('~/Pictures')
self.save_folder = os.path.expanduser("~/Pictures")
if not os.path.isdir(self.save_folder):
os.makedirs(self.save_folder)

def initialize(self):
# Register Camera GUI Events
self.gui.register_handler("CameraSkill.ViewPortStatus",
self.handle_camera_status)
self.gui.register_handler("CameraSkill.EndProcess",
self.handle_camera_completed)

self.gui.register_handler(
"CameraSkill.ViewPortStatus", self.handle_camera_status
)
self.gui.register_handler(
"CameraSkill.EndProcess", self.handle_camera_completed
)

@intent_handler("CaptureSingleShot.intent")
def handle_capture_single_shot(self, message):
self.speak_dialog('ack')
self.speak_dialog("ack")
self.gui["singleshot_mode"] = False
self.handle_camera_activity("singleshot")

@intent_handler("OpenCamera.intent")
def handle_open_camera(self, message):
self.speak_dialog('ack')
self.speak_dialog("ack")
self.gui["singleshot_mode"] = False
self.handle_camera_activity("generic")

def handle_camera_completed(self, message):
self.gui.remove_page("Camera.qml")
self.gui.release()

def handle_camera_status(self, message):
current_status = message.data.get("status")
if current_status == "generic":
Expand All @@ -58,9 +62,6 @@ def handle_camera_activity(self, activity):
def stop(self):
self.handle_camera_completed({})


def create_skill():
return CameraSkill()




0 comments on commit 0b5bb55

Please sign in to comment.