Started with error handling for not focusing
This commit is contained in:
@@ -91,10 +91,14 @@ class Camera:
|
|||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
error("Error during preview when calling '" + e.cmd + "'!\nOutput: "
|
error("Error during preview when calling '" + e.cmd + "'!\nOutput: "
|
||||||
+ e.output, e.returncode)
|
+ e.output, e.returncode)
|
||||||
if "ERROR" in output: error("Error during preview!\n" + output)
|
# Error 2019 is: cannot focus
|
||||||
|
if "Canon EOS Capture failed: 2019" in output: return False
|
||||||
|
elif "ERROR" in output: error("Error during preview!\n" + output)
|
||||||
|
return True
|
||||||
|
|
||||||
def preview(self, filename="/tmp/preview.jpg"):
|
def preview(self, filename="/tmp/preview.jpg"):
|
||||||
self.call_gphoto("--capture-preview", filename)
|
while not self.call_gphoto("--capture-preview", filename):
|
||||||
|
continue
|
||||||
return filename
|
return filename
|
||||||
|
|
||||||
def take_picture(self, filename="/tmp/picture.jpg"):
|
def take_picture(self, filename="/tmp/picture.jpg"):
|
||||||
|
|||||||
Reference in New Issue
Block a user