def capture_image(): timestring = 'gphoto_' + time.strftime('%Y%m%d_%H%M%S') + '.jpg' capture = gphoto.execute(['--set-config', '/main/actions/autofocusdrive=1', '--capture-image-and-download']) if "capt0000.jpg" in capture: # move the image to the static folder shutil.copy('capt0000.jpg', 'static/' + timestring) os.remove('capt0000.jpg') return timestring return "false"
def capture_image(): timestring = 'gphoto_' + time.strftime('%Y%m%d_%H%M%S') + '.jpg' capture = gphoto.execute([ '--set-config', '/main/actions/autofocusdrive=1', '--capture-image-and-download' ]) if "capt0000.jpg" in capture: # move the image to the static folder shutil.copy('capt0000.jpg', 'static/' + timestring) os.remove('capt0000.jpg') return timestring return "false"
def storage_info(): return gphoto.execute(['--storage-info'])
def capture_preview(): capture = gphoto.execute(['--set-config', '/main/actions/autofocusdrive=1', '--capture-preview'])
def get_config(): querystring = request.query.configkey.strip() return gphoto.execute(['--get-config', querystring])
def capture_preview(): capture = gphoto.execute([ '--set-config', '/main/actions/autofocusdrive=1', '--capture-preview' ])