Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a reference for what is accessible inside these "swig" objects? #41

Closed
ELI7VH opened this issue Nov 13, 2017 · 2 comments
Closed
Labels

Comments

@ELI7VH
Copy link

ELI7VH commented Nov 13, 2017

Hello. I am trying to look inside what is returned from these methods, such as man = gp.gp_camera_get_manual(camera) for example, and it gives me this array [-6, <Swig Object of type 'CameraText *' at 0x76a3b880>]

how can I look at what is inside this swig object as a string or list?

@jim-easterbrook
Copy link
Owner

The first element of the list is the C function's return status, in this case -6 which is GP_ERROR_NOT_SUPPORTED. See http://www.gphoto.org/doc/api/gphoto2-port-result_8h.html for a list of status values.

The second element is a CameraText object (Python wrapper around a C struct) that has one member called text. See http://www.gphoto.org/doc/api/structCameraText.html for more detail. You can access the text string by using str() as in the choose-camera.py example or as a Python attribute, in your case this would be man[1].text.

@ELI7VH
Copy link
Author

ELI7VH commented Nov 13, 2017

ok thanks. I finally found it after digging a while. Thanks this reference > http://www.gphoto.org/doc/api/ is precisely what I needed!

@ELI7VH ELI7VH closed this as completed Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants