Changes between Version 133 and Version 134 of UserGuideGit


Ignore:
Timestamp:
Mar 2, 2009, 11:03:09 AM (16 years ago)
Author:
Frédéric
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UserGuideGit

    v133 v134  
    1010 * [#Cutomization Cutomization]
    1111  * [#Stylesheet Style sheet]
     12 * [#Tetheredshooting Tethered shooting]
    1213 * [#Referencemanual Reference manual]
    1314  * [#Mainwindow Main window]
     
    148149''Note: a dedicated page for nice style sheets will soon be created. Feel free to send yours.''
    149150
     151== Tethered shooting ==
     152
     153It is possible to use an external program to make tethered shooting. The program needs to be run through a shell, where all parameters are given in command-line. If a '''{{{shoot.py}}}''' python script is found in the user config. dir, the 2 functions '''{{{mirrorLockup(stabilizationDelay))}}}''' and '''{{{shoot(bracketNumber)}}}''' will be called instead of internal ones.
     154
     155Here is an example script which can be used:
     156
     157{{{
     158#!python
     159import subprocess
     160
     161def mirrorLockup(delay):
     162    print "Mirror lockup (delay=%.1f)" % delay
     163    # See shoot() function
     164
     165
     166def shoot(bracket):
     167    print "Shoot (bracket=%d)" % bracket
     168
     169    # Launch external command
     170    #p = subprocess.Popen(["myTetheredShootingProgram", "-capture", "%d" % bracket], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
     171    p = subprocess.Popen(["gphoto2", "--help"], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
     172
     173    # Send data to external command input
     174    #p.stdin.write("bla")
     175
     176    # Wait end of external command execution
     177    p.wait()
     178
     179    # Print external command return code
     180    print "returncode=%d" % p.returncode
     181
     182    # Print external command output
     183    print p.stdout.read()
     184    #print p.stdout.readlines()
     185    #for line in p.stdout:
     186        #print line,
     187}}}
     188
     189More informations about ''subprocess'' module usage can be found here:
     190
     191 * [http://www.python.org/doc/2.5.4/lib/node528.html]
     192 * [http://www.python.org/doc/2.5.4/lib/node532.html]
     193
    150194== Reference manual ==
    151195