Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
size_bytes = value*ammnt
size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
i = int(math.floor(math.log(size_bytes, 1024)))
p = math.pow(1024, i)
size = round(size_bytes/p, 2)
storage = "" + str(size) + str(size_name[i])
return str(storage)
if param == "media_size":
size_bytes = value
size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
i = int(math.floor(math.log(size_bytes, 1024)))
p = math.pow(1024, i)
size = round(size_bytes/p, 2)
storage = "" + str(size) + str(size_name[i])
return str(storage)
if self.whichCam() == constants.Camera.Interface.GPControl:
if param == "mode":
if value == 0:
return "Video"
if value == 1:
return "Photo"
if value == 2:
return "Multi-Shot"
if param == "sub_mode":
if self.getStatus(constants.Status.Status, constants.Status.STATUS.Mode) == 0:
if value == 0:
return "Video"
if value == 1:
return "TimeLapse Video"
if value == 2:
return "Video+Photo"
if value == 3: