Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
print("current mode: " + "" + self.parse_value("mode",
self.getStatus(constants.Status.Status, constants.Status.STATUS.Mode)))
print("current submode: " + "" + self.parse_value("sub_mode",
self.getStatus(constants.Status.Status, constants.Status.STATUS.SubMode)))
print("current video resolution: " + "" + self.parse_value("video_res",
self.getStatus(constants.Status.Settings, constants.Video.RESOLUTION)))
print("current video framerate: " + "" + self.parse_value("video_fr",
self.getStatus(constants.Status.Settings, constants.Video.FRAME_RATE)))
print("pictures taken: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.PhotosTaken)))
print("videos taken: ", "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.VideosTaken)))
print("videos left: " + "" + self.parse_value("video_left",
self.getStatus(constants.Status.Status, constants.Status.STATUS.RemVideoTime)))
print("pictures left: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.RemPhotos)))
print("battery left: " + "" + self.parse_value("battery",
self.getStatus(constants.Status.Status, constants.Status.STATUS.BatteryLevel)))
print("space left in sd card: " + "" + self.parse_value("rem_space",
self.getStatus(constants.Status.Status, constants.Status.STATUS.RemainingSpace)))
print("camera SSID: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.CamName)))
print("Is Recording: " + "" + self.parse_value("recording",
self.getStatus(constants.Status.Status, constants.Status.STATUS.IsRecording)))
print("Clients connected: " + "" + str(self.getStatus(
constants.Status.Status, constants.Status.STATUS.IsConnected)))
print("camera model: " + "" + self.infoCamera(constants.Camera.Name))
print("firmware version: " + "" +
self.infoCamera(constants.Camera.Firmware))
print("serial number: " + "" +
self.infoCamera(constants.Camera.SerialNumber))
elif self.whichCam() == constants.Camera.Interface.Auth:
def overview(self):
if self.whichCam() == constants.Camera.Interface.GPControl:
print("camera overview")
print("current mode: " + "" + self.parse_value("mode",
self.getStatus(constants.Status.Status, constants.Status.STATUS.Mode)))
print("current submode: " + "" + self.parse_value("sub_mode",
self.getStatus(constants.Status.Status, constants.Status.STATUS.SubMode)))
print("current video resolution: " + "" + self.parse_value("video_res",
self.getStatus(constants.Status.Settings, constants.Video.RESOLUTION)))
print("current video framerate: " + "" + self.parse_value("video_fr",
self.getStatus(constants.Status.Settings, constants.Video.FRAME_RATE)))
print("pictures taken: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.PhotosTaken)))
print("videos taken: ", "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.VideosTaken)))
print("videos left: " + "" + self.parse_value("video_left",
self.getStatus(constants.Status.Status, constants.Status.STATUS.RemVideoTime)))
print("pictures left: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.RemPhotos)))
print("battery left: " + "" + self.parse_value("battery",
self.getStatus(constants.Status.Status, constants.Status.STATUS.BatteryLevel)))
print("space left in sd card: " + "" + self.parse_value("rem_space",
self.getStatus(constants.Status.Status, constants.Status.STATUS.RemainingSpace)))
def overview(self):
if self.whichCam() == constants.Camera.Interface.GPControl:
print("camera overview")
print("current mode: " + "" + self.parse_value("mode",
self.getStatus(constants.Status.Status, constants.Status.STATUS.Mode)))
print("current submode: " + "" + self.parse_value("sub_mode",
self.getStatus(constants.Status.Status, constants.Status.STATUS.SubMode)))
print("current video resolution: " + "" + self.parse_value("video_res",
self.getStatus(constants.Status.Settings, constants.Video.RESOLUTION)))
print("current video framerate: " + "" + self.parse_value("video_fr",
self.getStatus(constants.Status.Settings, constants.Video.FRAME_RATE)))
print("pictures taken: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.PhotosTaken)))
print("videos taken: ", "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.VideosTaken)))
print("videos left: " + "" + self.parse_value("video_left",
self.getStatus(constants.Status.Status, constants.Status.STATUS.RemVideoTime)))
print("pictures left: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.RemPhotos)))
print("battery left: " + "" + self.parse_value("battery",
self.getStatus(constants.Status.Status, constants.Status.STATUS.BatteryLevel)))
print("space left in sd card: " + "" + self.parse_value("rem_space",
self.getStatus(constants.Status.Status, constants.Status.STATUS.RemainingSpace)))
print("camera SSID: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.CamName)))
print("Is Recording: " + "" + self.parse_value("recording",
self.getStatus(constants.Status.Status, constants.Status.STATUS.IsRecording)))
print("Clients connected: " + "" + str(self.getStatus(
constants.Status.Status, constants.Status.STATUS.IsConnected)))
print("camera model: " + "" + self.infoCamera(constants.Camera.Name))
print("firmware version: " + "" +
def overview(self):
if self.whichCam() == constants.Camera.Interface.GPControl:
print("camera overview")
print("current mode: " + "" + self.parse_value("mode",
self.getStatus(constants.Status.Status, constants.Status.STATUS.Mode)))
print("current submode: " + "" + self.parse_value("sub_mode",
self.getStatus(constants.Status.Status, constants.Status.STATUS.SubMode)))
print("current video resolution: " + "" + self.parse_value("video_res",
self.getStatus(constants.Status.Settings, constants.Video.RESOLUTION)))
print("current video framerate: " + "" + self.parse_value("video_fr",
self.getStatus(constants.Status.Settings, constants.Video.FRAME_RATE)))
print("pictures taken: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.PhotosTaken)))
print("videos taken: ", "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.VideosTaken)))
print("videos left: " + "" + self.parse_value("video_left",
self.getStatus(constants.Status.Status, constants.Status.STATUS.RemVideoTime)))
print("pictures left: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.RemPhotos)))
print("battery left: " + "" + self.parse_value("battery",
self.getStatus(constants.Status.Status, constants.Status.STATUS.BatteryLevel)))
print("current video resolution: " + "" + self.parse_value("video_res",
self.getStatus(constants.Status.Settings, constants.Video.RESOLUTION)))
print("current video framerate: " + "" + self.parse_value("video_fr",
self.getStatus(constants.Status.Settings, constants.Video.FRAME_RATE)))
print("pictures taken: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.PhotosTaken)))
print("videos taken: ", "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.VideosTaken)))
print("videos left: " + "" + self.parse_value("video_left",
self.getStatus(constants.Status.Status, constants.Status.STATUS.RemVideoTime)))
print("pictures left: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.RemPhotos)))
print("battery left: " + "" + self.parse_value("battery",
self.getStatus(constants.Status.Status, constants.Status.STATUS.BatteryLevel)))
print("space left in sd card: " + "" + self.parse_value("rem_space",
self.getStatus(constants.Status.Status, constants.Status.STATUS.RemainingSpace)))
print("camera SSID: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.CamName)))
print("Is Recording: " + "" + self.parse_value("recording",
self.getStatus(constants.Status.Status, constants.Status.STATUS.IsRecording)))
print("Clients connected: " + "" + str(self.getStatus(
constants.Status.Status, constants.Status.STATUS.IsConnected)))
print("camera model: " + "" + self.infoCamera(constants.Camera.Name))
print("firmware version: " + "" +
self.infoCamera(constants.Camera.Firmware))
print("serial number: " + "" +
self.infoCamera(constants.Camera.SerialNumber))
elif self.whichCam() == constants.Camera.Interface.Auth:
# HERO3
print("camera overview")
print("current mode: " + self.parse_value(constants.Hero3Status.Mode,
self.getStatus(constants.Hero3Status.Mode)))
print("pictures taken: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.PhotosTaken)))
print("videos taken: ", "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.VideosTaken)))
print("videos left: " + "" + self.parse_value("video_left",
self.getStatus(constants.Status.Status, constants.Status.STATUS.RemVideoTime)))
print("pictures left: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.RemPhotos)))
print("battery left: " + "" + self.parse_value("battery",
self.getStatus(constants.Status.Status, constants.Status.STATUS.BatteryLevel)))
print("space left in sd card: " + "" + self.parse_value("rem_space",
self.getStatus(constants.Status.Status, constants.Status.STATUS.RemainingSpace)))
print("camera SSID: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.CamName)))
print("Is Recording: " + "" + self.parse_value("recording",
self.getStatus(constants.Status.Status, constants.Status.STATUS.IsRecording)))
print("Clients connected: " + "" + str(self.getStatus(
constants.Status.Status, constants.Status.STATUS.IsConnected)))
print("camera model: " + "" + self.infoCamera(constants.Camera.Name))
print("firmware version: " + "" +
self.infoCamera(constants.Camera.Firmware))
print("serial number: " + "" +
self.infoCamera(constants.Camera.SerialNumber))
elif self.whichCam() == constants.Camera.Interface.Auth:
# HERO3
print("camera overview")
print("current mode: " + self.parse_value(constants.Hero3Status.Mode,
self.getStatus(constants.Hero3Status.Mode)))
print("current video resolution: " + self.parse_value(
constants.Hero3Status.VideoRes, self.getStatus(constants.Hero3Status.VideoRes)))
print("current photo resolution: " + self.parse_value(
constants.Hero3Status.PicRes, self.getStatus(constants.Hero3Status.PicRes)))
print("videos taken: ", "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.VideosTaken)))
print("videos left: " + "" + self.parse_value("video_left",
self.getStatus(constants.Status.Status, constants.Status.STATUS.RemVideoTime)))
print("pictures left: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.RemPhotos)))
print("battery left: " + "" + self.parse_value("battery",
self.getStatus(constants.Status.Status, constants.Status.STATUS.BatteryLevel)))
print("space left in sd card: " + "" + self.parse_value("rem_space",
self.getStatus(constants.Status.Status, constants.Status.STATUS.RemainingSpace)))
print("camera SSID: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.CamName)))
print("Is Recording: " + "" + self.parse_value("recording",
self.getStatus(constants.Status.Status, constants.Status.STATUS.IsRecording)))
print("Clients connected: " + "" + str(self.getStatus(
constants.Status.Status, constants.Status.STATUS.IsConnected)))
print("camera model: " + "" + self.infoCamera(constants.Camera.Name))
print("firmware version: " + "" +
self.infoCamera(constants.Camera.Firmware))
print("serial number: " + "" +
self.infoCamera(constants.Camera.SerialNumber))
elif self.whichCam() == constants.Camera.Interface.Auth:
# HERO3
print("camera overview")
print("current mode: " + self.parse_value(constants.Hero3Status.Mode,
self.getStatus(constants.Hero3Status.Mode)))
print("current video resolution: " + self.parse_value(
constants.Hero3Status.VideoRes, self.getStatus(constants.Hero3Status.VideoRes)))
print("current photo resolution: " + self.parse_value(
constants.Hero3Status.PicRes, self.getStatus(constants.Hero3Status.PicRes)))
print("current timelapse interval: " + self.parse_value(constants.Hero3Status.TimeLapseInterval,
self.getStatus(constants.Hero3Status.TimeLapseInterval)))
print("current submode: " + "" + self.parse_value("sub_mode",
self.getStatus(constants.Status.Status, constants.Status.STATUS.SubMode)))
print("current video resolution: " + "" + self.parse_value("video_res",
self.getStatus(constants.Status.Settings, constants.Video.RESOLUTION)))
print("current video framerate: " + "" + self.parse_value("video_fr",
self.getStatus(constants.Status.Settings, constants.Video.FRAME_RATE)))
print("pictures taken: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.PhotosTaken)))
print("videos taken: ", "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.VideosTaken)))
print("videos left: " + "" + self.parse_value("video_left",
self.getStatus(constants.Status.Status, constants.Status.STATUS.RemVideoTime)))
print("pictures left: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.RemPhotos)))
print("battery left: " + "" + self.parse_value("battery",
self.getStatus(constants.Status.Status, constants.Status.STATUS.BatteryLevel)))
print("space left in sd card: " + "" + self.parse_value("rem_space",
self.getStatus(constants.Status.Status, constants.Status.STATUS.RemainingSpace)))
print("camera SSID: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.CamName)))
print("Is Recording: " + "" + self.parse_value("recording",
self.getStatus(constants.Status.Status, constants.Status.STATUS.IsRecording)))
print("Clients connected: " + "" + str(self.getStatus(
constants.Status.Status, constants.Status.STATUS.IsConnected)))
print("camera model: " + "" + self.infoCamera(constants.Camera.Name))
print("firmware version: " + "" +
self.infoCamera(constants.Camera.Firmware))
print("serial number: " + "" +
self.infoCamera(constants.Camera.SerialNumber))
elif self.whichCam() == constants.Camera.Interface.Auth:
# HERO3
print("camera overview")
def shoot_video(self, duration=0):
"""Shoots a video, if duration is 0 it will not stop the video, set duration to an integer to set the video duration."""
self.mode(constants.Mode.VideoMode)
time.sleep(1)
self.shutter(constants.start)
if duration != 0 and duration > 2:
time.sleep(duration)
self.shutter(constants.stop)
if self.whichCam() == constants.Camera.Interface.GPControl:
ready = int(self.getStatus(constants.Status.Status,
constants.Status.STATUS.IsBusy))
while ready == 1:
ready = int(self.getStatus(
constants.Status.Status, constants.Status.STATUS.IsBusy))
return self.getMedia()
elif self.whichCam() == constants.Camera.Interface.Auth:
ready = str(self.getStatus(constants.Hero3Status.IsRecording))
while ready == "01":
ready = str(self.getStatus(
constants.Hero3Status.IsRecording))
return self.getMedia()
print("current video framerate: " + "" + self.parse_value("video_fr",
self.getStatus(constants.Status.Settings, constants.Video.FRAME_RATE)))
print("pictures taken: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.PhotosTaken)))
print("videos taken: ", "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.VideosTaken)))
print("videos left: " + "" + self.parse_value("video_left",
self.getStatus(constants.Status.Status, constants.Status.STATUS.RemVideoTime)))
print("pictures left: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.RemPhotos)))
print("battery left: " + "" + self.parse_value("battery",
self.getStatus(constants.Status.Status, constants.Status.STATUS.BatteryLevel)))
print("space left in sd card: " + "" + self.parse_value("rem_space",
self.getStatus(constants.Status.Status, constants.Status.STATUS.RemainingSpace)))
print("camera SSID: " + "" + str(self.getStatus(constants.Status.Status,
constants.Status.STATUS.CamName)))
print("Is Recording: " + "" + self.parse_value("recording",
self.getStatus(constants.Status.Status, constants.Status.STATUS.IsRecording)))
print("Clients connected: " + "" + str(self.getStatus(
constants.Status.Status, constants.Status.STATUS.IsConnected)))
print("camera model: " + "" + self.infoCamera(constants.Camera.Name))
print("firmware version: " + "" +
self.infoCamera(constants.Camera.Firmware))
print("serial number: " + "" +
self.infoCamera(constants.Camera.SerialNumber))
elif self.whichCam() == constants.Camera.Interface.Auth:
# HERO3
print("camera overview")
print("current mode: " + self.parse_value(constants.Hero3Status.Mode,
self.getStatus(constants.Hero3Status.Mode)))
print("current video resolution: " + self.parse_value(
constants.Hero3Status.VideoRes, self.getStatus(constants.Hero3Status.VideoRes)))