I am playing around with gphoto2 and I found that camera
object has a public function file_get_info()
. I would like to know:
- what this function does
- how to call it
But so far I have failed to find any information about it.
This is what I do:
import gphoto2 as gp
portInfoList = gp.PortInfoList()
portInfoList.load()
abilitiesList = gp.CameraAbilitiesList()
abilitiesList.load()
cams = abilitiesList.detect(portInfoList)
for name, addr in cams:
print("%s at port %s"%(name, addr))
idx = portInfoList.lookup_path(addr)
camera = gp.Camera()
camera.set_port_info(portInfoList[idx])
camera.init()
camera.file_get_info()
This is what I get:
TypeError: Camera_file_get_info expected at least 2 arguments, got 0
What is even more frustrating is that no matter how hard I google I cannot find anything about the Camera_file_get_info
function.
Am I approaching this wrong?
The
file_get_info
method on aCamera
object is a more Pythonic version of the libgphoto2 functiongp_camera_file_get_info
. This would be a better term for web searching.There are several ways to get the information you're looking for. Like other Python modules you can use pydoc:
This is taken from the "C" documentation, so the parameter list is a bit confusing -
info
is a parameter in the C version but not in Python. The two parameters you need arefolder
andfile
- these tell the function which file you want information about.You might prefer to use the C documentation directly: http://www.gphoto.org/doc/api/gphoto2-camera_8h.html#adda54321b1947b711d345936041f80c7 This includes a link to the
info
structure.Finally, the
list-files.py
example program included inpython-gphoto2
shows a use offile_get_info
.