jbaiter/spreads — pull request #2 by matti-kariluoma (2014-02-12 00:39:10+00:00)
Title: A1400cameradevice

I encountered a strange race condition with set_zoom on (only one of?) my a1400s. This setting wait=True fixes, rolled up a CameraDevice class to hold this.

The error I was seeing before implementing this:
...
ChdkCamera[right]: Calling chdkptp with arguments: [u'/usr/local/lib/chdkptp/chdkptp', '-c-d=033 -b=001', '-eset cli_verbose=2', '-elua set_zoom(3)']
ChdkCamera[left]: Calling chdkptp with arguments: [u'/usr/local/lib/chdkptp/chdkptp', '-c-d=034 -b=001', '-eset cli_verbose=2', '-elua set_zoom(3)']
ChdkCamera[right]: Calling chdkptp with arguments: [u'/usr/local/lib/chdkptp/chdkptp', '-c-d=033 -b=001', '-eset cli_verbose=2', '-eluar while(get_flash_mode()<2) do click("right") end']
ChdkCamera[left]: Call returned:
['connected: Canon PowerShot A1400, max packet size 512']
ChdkCamera[left]: Calling chdkptp with arguments: [u'/usr/local/lib/chdkptp/chdkptp', '-c-d=034 -b=001', '-eset cli_verbose=2', '-eluar while(get_flash_mode()<2) do click("right") end']
ChdkCamera[right]: Call returned:
['ERROR: a script is already running', 'connected: Canon PowerShot A1400, max packet size 512']
ChdkCamera[left]: Call returned:
['connected: Canon PowerShot A1400, max packet size 512']
ChdkCamera[left]: Calling chdkptp with arguments: [u'/usr/local/lib/chdkptp/chdkptp', '-c-d=034 -b=001', '-eset cli_verbose=2', '-eluar set_nd_filter(2)']
ChdkCamera[left]: Call returned:
['connected: Canon PowerShot A1400, max packet size 512']
ChdkCamera[left]: Calling chdkptp with arguments: [u'/usr/local/lib/chdkptp/chdkptp', '-c-d=034 -b=001', '-eset cli_verbose=2', '-eluar set_aflock(0)']
ChdkCamera[left]: Call returned:
['connected: Canon PowerShot A1400, max packet size 512']
spreads encountered an error:
Traceback (most recent call last):
File "/usr/local/bin/spread", line 39, in
cli.main()
File "/usr/local/lib/python2.7/dist-packages/spreads/cli.py", line 446, in main
args.subcommand(config)
File "/usr/local/lib/python2.7/dist-packages/spreads/cli.py", line 254, in capture
workflow.prepare_capture()
File "/usr/local/lib/python2.7/dist-packages/spreads/workflow.py", line 163, in prepare_capture
check_futures_exceptions(futures)
File "/usr/local/lib/python2.7/dist-packages/spreads/util.py", line 63, in check_futures_exceptions
raise exc
CHDKPTPException: ERROR: a script is already running