diff --git a/ChangeLog b/ChangeLog index be4c9bcfb..9dec9636c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-08-30 Hubert Figuiere + + * bindings/java: Java bindings from patch# 1108091 + http://sf.net/tracker/?func=detail&aid=1108091&group_id=8874&atid=308874 + * bindings/python: Python binding from patch# 1152835 + http://sf.net/tracker/?func=detail&aid=1152835&group_id=8874&atid=308874 + 2005-08-25 Marcus Meissner * libgphoto2/gphoto2-filesys.c diff --git a/bindings/python/INSTALL b/bindings/python/INSTALL new file mode 100644 index 000000000..c896f21a2 --- /dev/null +++ b/bindings/python/INSTALL @@ -0,0 +1,7 @@ +To install this python extension, you just have to type : + +# python setup.py build +# sudo python setup.py install + +then you can run the test program : +# python gptest.py diff --git a/bindings/python/README b/bindings/python/README new file mode 100644 index 000000000..479b7f907 --- /dev/null +++ b/bindings/python/README @@ -0,0 +1,17 @@ +Python language bindings for gphoto2 using PyRex (http://nz.cosc.canterbury.ac.nz/~greg/python/Pyrex/) + +Copyright (C) 2003-2004 David PHAM-VAN -- david@ab2r.com + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA diff --git a/bindings/python/gphoto2.c b/bindings/python/gphoto2.c new file mode 100644 index 000000000..4674ea4d1 --- /dev/null +++ b/bindings/python/gphoto2.c @@ -0,0 +1,2659 @@ +/* Generated by Pyrex 0.9.3 on Sun Feb 27 11:47:16 2005 */ + +#include "Python.h" +#include "structmember.h" +#ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG +#endif +#include "time.h" +#include "gphoto2-port-version.h" +#include "gphoto2-version.h" +#include "gphoto2-context.h" +#include "gphoto2-port-info-list.h" +#include "gphoto2-port.h" +#include "gphoto2-port-log.h" +#include "gphoto2-port-result.h" +#include "gphoto2-widget.h" +#include "gphoto2-file.h" +#include "gphoto2-list.h" +#include "gphoto2-filesys.h" +#include "gphoto2-abilities-list.h" +#include "gphoto2-camera.h" +#include "gphoto2-library.h" +#include "gphoto2-setting.h" + + +typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/ +typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ +static PyObject *__Pyx_UnpackItem(PyObject *, int); /*proto*/ +static int __Pyx_EndUnpack(PyObject *, int); /*proto*/ +static int __Pyx_PrintItem(PyObject *); /*proto*/ +static int __Pyx_PrintNewline(void); /*proto*/ +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ +static void __Pyx_ReRaise(void); /*proto*/ +static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ +static PyObject *__Pyx_GetExcValue(void); /*proto*/ +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/ +static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ +static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/ +static void __Pyx_WriteUnraisable(char *name); /*proto*/ +static void __Pyx_AddTraceback(char *funcname); /*proto*/ +static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/ +static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ +static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/ +static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/ +static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/ +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ + +static PyObject *__pyx_m; +static PyObject *__pyx_b; +static int __pyx_lineno; +static char *__pyx_filename; +staticforward char **__pyx_f; + +/* Declarations from gphoto2 */ + +staticforward PyTypeObject __pyx_type_7gphoto2_portInfo; + +struct __pyx_obj_7gphoto2_portInfo { + PyObject_HEAD + GPPortInfo info; +}; + +staticforward PyTypeObject __pyx_type_7gphoto2_ports; + +struct __pyx_obj_7gphoto2_ports { + PyObject_HEAD + GPPortInfoList (*portInfoList); +}; + +staticforward PyTypeObject __pyx_type_7gphoto2_cameraList; + +struct __pyx_obj_7gphoto2_cameraList { + PyObject_HEAD + CameraList (*liste); +}; + +staticforward PyTypeObject __pyx_type_7gphoto2_cameraAbilities; + +struct __pyx_obj_7gphoto2_cameraAbilities { + PyObject_HEAD + CameraAbilities abilitie; +}; + +staticforward PyTypeObject __pyx_type_7gphoto2_abilities_list; + +struct __pyx_obj_7gphoto2_abilities_list { + PyObject_HEAD + CameraAbilitiesList (*abilitiesList); +}; + +staticforward PyTypeObject __pyx_type_7gphoto2_camera; + +struct __pyx_obj_7gphoto2_camera { + PyObject_HEAD + Camera (*camera); +}; + +static PyTypeObject *__pyx_ptype_7gphoto2_portInfo = 0; +static PyTypeObject *__pyx_ptype_7gphoto2_ports = 0; +static PyTypeObject *__pyx_ptype_7gphoto2_cameraList = 0; +static PyTypeObject *__pyx_ptype_7gphoto2_cameraAbilities = 0; +static PyTypeObject *__pyx_ptype_7gphoto2_abilities_list = 0; +static PyTypeObject *__pyx_ptype_7gphoto2_camera = 0; +static PyObject *__pyx_k1; +static PyObject *(__pyx_f_7gphoto2_check(PyObject *)); /*proto*/ + +/* Implementation of gphoto2 */ + +static PyObject *__pyx_n_version; +static PyObject *__pyx_n_False; + +static PyObject *__pyx_f_7gphoto2_version(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_7gphoto2_version(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_verbose = 0; + char (*(*__pyx_v_cText)); + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + static char *__pyx_argnames[] = {"verbose",0}; + __pyx_v_verbose = __pyx_k1; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_verbose)) return 0; + Py_INCREF(__pyx_v_verbose); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":759 */ + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_v_verbose, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;} + __pyx_2 = __pyx_2 == 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; + if (__pyx_2) { + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":760 */ + __pyx_v_cText = ((char (*(*)))gp_library_version(GP_VERSION_SHORT)); + goto __pyx_L2; + } + /*else*/ { + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":762 */ + __pyx_v_cText = ((char (*(*)))gp_library_version(GP_VERSION_VERBOSE)); + } + __pyx_L2:; + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":763 */ + __pyx_1 = PyString_FromString((__pyx_v_cText[0])); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.version"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_verbose); + return __pyx_r; +} + +static PyObject *__pyx_n_Exception; +static PyObject *__pyx_n_str; + +static PyObject *__pyx_k2p; +static PyObject *__pyx_k3p; + +static char (__pyx_k2[]) = "Erreur ("; +static char (__pyx_k3[]) = ") : "; + +static PyObject *__pyx_f_7gphoto2_check(PyObject *__pyx_v_result) { + PyObject *__pyx_v_txt; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + int __pyx_2; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + PyObject *__pyx_5 = 0; + Py_INCREF(__pyx_v_result); + __pyx_v_txt = Py_None; Py_INCREF(__pyx_v_txt); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":766 */ + __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_v_result, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;} + __pyx_2 = __pyx_2 != 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; + if (__pyx_2) { + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":767 */ + __pyx_2 = PyInt_AsLong(__pyx_v_result); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; goto __pyx_L1;} + __pyx_1 = PyString_FromString(gp_result_as_string(__pyx_2)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; goto __pyx_L1;} + Py_DECREF(__pyx_v_txt); + __pyx_v_txt = __pyx_1; + __pyx_1 = 0; + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":768 */ + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_Exception); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} + Py_INCREF(__pyx_v_result); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_result); + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = PyNumber_Add(__pyx_k2p, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_4 = PyNumber_Add(__pyx_3, __pyx_k3p); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_5 = PyNumber_Add(__pyx_4, __pyx_v_txt); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5); + __pyx_5 = 0; + __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} + goto __pyx_L2; + } + __pyx_L2:; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_5); + __Pyx_AddTraceback("gphoto2.check"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_txt); + Py_DECREF(__pyx_v_result); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_8portInfo___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_7gphoto2_8portInfo___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":774 */ + __pyx_1 = PyString_FromString(((struct __pyx_obj_7gphoto2_portInfo *)__pyx_v_self)->info.name); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.portInfo.__repr__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static int __pyx_f_7gphoto2_5ports___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_7gphoto2_5ports___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":780 */ + __pyx_1 = PyInt_FromLong(gp_port_info_list_new((&((struct __pyx_obj_7gphoto2_ports *)__pyx_v_self)->portInfoList))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.ports.__new__"); + __pyx_r = -1; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static void __pyx_f_7gphoto2_5ports___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_f_7gphoto2_5ports___dealloc__(PyObject *__pyx_v_self) { + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":783 */ + __pyx_1 = PyInt_FromLong(gp_port_info_list_free(((struct __pyx_obj_7gphoto2_ports *)__pyx_v_self)->portInfoList)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.ports.__dealloc__"); + __pyx_L0:; + Py_DECREF(__pyx_v_self); +} + +static PyObject *__pyx_f_7gphoto2_5ports_load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_7gphoto2_5ports_load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":786 */ + __pyx_1 = PyInt_FromLong(gp_port_info_list_load(((struct __pyx_obj_7gphoto2_ports *)__pyx_v_self)->portInfoList)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.ports.load"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_5ports_count(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_7gphoto2_5ports_count(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":789 */ + __pyx_1 = PyInt_FromLong(gp_port_info_list_count(((struct __pyx_obj_7gphoto2_ports *)__pyx_v_self)->portInfoList)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.ports.count"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_5ports___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_num); /*proto*/ +static PyObject *__pyx_f_7gphoto2_5ports___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_num) { + struct __pyx_obj_7gphoto2_portInfo *__pyx_v_info; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + int __pyx_3; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_num); + ((PyObject*)__pyx_v_info) = Py_None; Py_INCREF(((PyObject*)__pyx_v_info)); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":793 */ + __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_7gphoto2_portInfo), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_7gphoto2_portInfo)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_info)); + ((PyObject *)__pyx_v_info) = __pyx_2; + __pyx_2 = 0; + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":794 */ + __pyx_3 = PyInt_AsLong(__pyx_v_num); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(gp_port_info_list_get_info(((struct __pyx_obj_7gphoto2_ports *)__pyx_v_self)->portInfoList,__pyx_3,(&__pyx_v_info->info))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":795 */ + Py_INCREF(((PyObject *)__pyx_v_info)); + __pyx_r = ((PyObject *)__pyx_v_info); + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.ports.__getitem__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_info); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_num); + return __pyx_r; +} + +static int __pyx_f_7gphoto2_10cameraList___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_7gphoto2_10cameraList___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":801 */ + __pyx_1 = PyInt_FromLong(gp_list_new((&((struct __pyx_obj_7gphoto2_cameraList *)__pyx_v_self)->liste))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.cameraList.__new__"); + __pyx_r = -1; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static void __pyx_f_7gphoto2_10cameraList___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_f_7gphoto2_10cameraList___dealloc__(PyObject *__pyx_v_self) { + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":804 */ + __pyx_1 = PyInt_FromLong(gp_list_free(((struct __pyx_obj_7gphoto2_cameraList *)__pyx_v_self)->liste)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 804; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.cameraList.__dealloc__"); + __pyx_L0:; + Py_DECREF(__pyx_v_self); +} + +static PyObject *__pyx_f_7gphoto2_10cameraList_count(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_7gphoto2_10cameraList_count(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":807 */ + __pyx_1 = PyInt_FromLong(gp_list_count(((struct __pyx_obj_7gphoto2_cameraList *)__pyx_v_self)->liste)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.cameraList.count"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_10cameraList___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_f_7gphoto2_10cameraList___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { + char (*__pyx_v_name); + char (*__pyx_v_value); + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_index); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":812 */ + __pyx_1 = PyInt_AsLong(__pyx_v_index); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(gp_list_get_name(((struct __pyx_obj_7gphoto2_cameraList *)__pyx_v_self)->liste,__pyx_1,(&__pyx_v_name))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;} + __pyx_3 = __pyx_f_7gphoto2_check(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":813 */ + __pyx_1 = PyInt_AsLong(__pyx_v_index); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(gp_list_get_value(((struct __pyx_obj_7gphoto2_cameraList *)__pyx_v_self)->liste,__pyx_1,(&__pyx_v_value))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;} + __pyx_3 = __pyx_f_7gphoto2_check(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":814 */ + __pyx_2 = PyString_FromString(__pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;} + __pyx_3 = PyString_FromString(__pyx_v_value); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 814; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); + __pyx_2 = 0; + __pyx_3 = 0; + __pyx_r = __pyx_4; + __pyx_4 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + __Pyx_AddTraceback("gphoto2.cameraList.__getitem__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_index); + return __pyx_r; +} + +static int __pyx_f_7gphoto2_15cameraAbilities___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_7gphoto2_15cameraAbilities___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":820 */ + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1:; + __Pyx_AddTraceback("gphoto2.cameraAbilities.__new__"); + __pyx_r = -1; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_k4p; + +static char (__pyx_k4[]) = "Model : %s\nStatus : %d\nPort : %d\nOperations : %d\nFile Operations : %d\nFolder Operations : %d\nUSB (vendor/product) : %d/%d\nUSB class : %d/%d/%d\nLibrary : %s\nId : %s\n"; + +static PyObject *__pyx_f_7gphoto2_15cameraAbilities___repr__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_7gphoto2_15cameraAbilities___repr__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + PyObject *__pyx_5 = 0; + PyObject *__pyx_6 = 0; + PyObject *__pyx_7 = 0; + PyObject *__pyx_8 = 0; + PyObject *__pyx_9 = 0; + PyObject *__pyx_10 = 0; + PyObject *__pyx_11 = 0; + PyObject *__pyx_12 = 0; + PyObject *__pyx_13 = 0; + PyObject *__pyx_14 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":823 */ + __pyx_1 = PyString_FromString(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.model); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.status); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.port); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.operations); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.file_operations); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} + __pyx_6 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.folder_operations); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} + __pyx_7 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.usb_vendor); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} + __pyx_8 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.usb_product); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} + __pyx_9 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.usb_class); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} + __pyx_10 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.usb_subclass); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} + __pyx_11 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.usb_protocol); if (!__pyx_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} + __pyx_12 = PyString_FromString(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.library); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} + __pyx_13 = PyString_FromString(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.id); if (!__pyx_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} + __pyx_14 = PyTuple_New(13); if (!__pyx_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_14, 0, __pyx_1); + PyTuple_SET_ITEM(__pyx_14, 1, __pyx_2); + PyTuple_SET_ITEM(__pyx_14, 2, __pyx_3); + PyTuple_SET_ITEM(__pyx_14, 3, __pyx_4); + PyTuple_SET_ITEM(__pyx_14, 4, __pyx_5); + PyTuple_SET_ITEM(__pyx_14, 5, __pyx_6); + PyTuple_SET_ITEM(__pyx_14, 6, __pyx_7); + PyTuple_SET_ITEM(__pyx_14, 7, __pyx_8); + PyTuple_SET_ITEM(__pyx_14, 8, __pyx_9); + PyTuple_SET_ITEM(__pyx_14, 9, __pyx_10); + PyTuple_SET_ITEM(__pyx_14, 10, __pyx_11); + PyTuple_SET_ITEM(__pyx_14, 11, __pyx_12); + PyTuple_SET_ITEM(__pyx_14, 12, __pyx_13); + __pyx_1 = 0; + __pyx_2 = 0; + __pyx_3 = 0; + __pyx_4 = 0; + __pyx_5 = 0; + __pyx_6 = 0; + __pyx_7 = 0; + __pyx_8 = 0; + __pyx_9 = 0; + __pyx_10 = 0; + __pyx_11 = 0; + __pyx_12 = 0; + __pyx_13 = 0; + __pyx_1 = PyNumber_Remainder(__pyx_k4p, __pyx_14); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} + Py_DECREF(__pyx_14); __pyx_14 = 0; + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_5); + Py_XDECREF(__pyx_6); + Py_XDECREF(__pyx_7); + Py_XDECREF(__pyx_8); + Py_XDECREF(__pyx_9); + Py_XDECREF(__pyx_10); + Py_XDECREF(__pyx_11); + Py_XDECREF(__pyx_12); + Py_XDECREF(__pyx_13); + Py_XDECREF(__pyx_14); + __Pyx_AddTraceback("gphoto2.cameraAbilities.__repr__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_5model___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_5model___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":827 */ + __pyx_1 = PyString_FromString(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.model); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.cameraAbilities.model.__get__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_6status___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_6status___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":831 */ + __pyx_1 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.status); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.cameraAbilities.status.__get__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_4port___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_4port___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":835 */ + __pyx_1 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.port); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.cameraAbilities.port.__get__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_10operations___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_10operations___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":839 */ + __pyx_1 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.operations); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.cameraAbilities.operations.__get__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_15file_operations___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_15file_operations___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":843 */ + __pyx_1 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.file_operations); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.cameraAbilities.file_operations.__get__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_17folder_operations___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_17folder_operations___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":847 */ + __pyx_1 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.folder_operations); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.cameraAbilities.folder_operations.__get__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_10usb_vendor___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_10usb_vendor___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":851 */ + __pyx_1 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.usb_vendor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.cameraAbilities.usb_vendor.__get__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_11usb_product___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_11usb_product___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":855 */ + __pyx_1 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.usb_product); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.cameraAbilities.usb_product.__get__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_9usb_class___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_9usb_class___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":859 */ + __pyx_1 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.usb_class); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.cameraAbilities.usb_class.__get__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_12usb_subclass___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_12usb_subclass___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":863 */ + __pyx_1 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.usb_subclass); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.cameraAbilities.usb_subclass.__get__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_12usb_protocol___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_12usb_protocol___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":867 */ + __pyx_1 = PyInt_FromLong(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.usb_protocol); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.cameraAbilities.usb_protocol.__get__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_7library___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_7library___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":871 */ + __pyx_1 = PyString_FromString(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.library); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.cameraAbilities.library.__get__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_2id___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_7gphoto2_15cameraAbilities_2id___get__(PyObject *__pyx_v_self) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":875 */ + __pyx_1 = PyString_FromString(((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_self)->abilitie.id); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.cameraAbilities.id.__get__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static int __pyx_f_7gphoto2_14abilities_list___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_7gphoto2_14abilities_list___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":881 */ + __pyx_1 = PyInt_FromLong(gp_abilities_list_new((&((struct __pyx_obj_7gphoto2_abilities_list *)__pyx_v_self)->abilitiesList))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.abilities_list.__new__"); + __pyx_r = -1; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static void __pyx_f_7gphoto2_14abilities_list___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_f_7gphoto2_14abilities_list___dealloc__(PyObject *__pyx_v_self) { + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":884 */ + __pyx_1 = PyInt_FromLong(gp_abilities_list_free(((struct __pyx_obj_7gphoto2_abilities_list *)__pyx_v_self)->abilitiesList)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.abilities_list.__dealloc__"); + __pyx_L0:; + Py_DECREF(__pyx_v_self); +} + +static PyObject *__pyx_f_7gphoto2_14abilities_list_count(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_7gphoto2_14abilities_list_count(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":887 */ + __pyx_1 = PyInt_FromLong(gp_abilities_list_count(((struct __pyx_obj_7gphoto2_abilities_list *)__pyx_v_self)->abilitiesList)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2.abilities_list.count"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_14abilities_list_load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_7gphoto2_14abilities_list_load(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":890 */ + __pyx_1 = PyInt_FromLong(gp_abilities_list_load(((struct __pyx_obj_7gphoto2_abilities_list *)__pyx_v_self)->abilitiesList,0)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.abilities_list.load"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_14abilities_list___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/ +static PyObject *__pyx_f_7gphoto2_14abilities_list___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) { + struct __pyx_obj_7gphoto2_cameraAbilities *__pyx_v_ab; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + int __pyx_3; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_index); + ((PyObject*)__pyx_v_ab) = Py_None; Py_INCREF(((PyObject*)__pyx_v_ab)); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":894 */ + __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_7gphoto2_cameraAbilities), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_7gphoto2_cameraAbilities)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_ab)); + ((PyObject *)__pyx_v_ab) = __pyx_2; + __pyx_2 = 0; + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":895 */ + __pyx_3 = PyInt_AsLong(__pyx_v_index); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(gp_abilities_list_get_abilities(((struct __pyx_obj_7gphoto2_abilities_list *)__pyx_v_self)->abilitiesList,__pyx_3,(&__pyx_v_ab->abilitie))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":896 */ + Py_INCREF(((PyObject *)__pyx_v_ab)); + __pyx_r = ((PyObject *)__pyx_v_ab); + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.abilities_list.__getitem__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_ab); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_index); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_14abilities_list_lookup_model(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_7gphoto2_14abilities_list_lookup_model(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_model = 0; + PyObject *__pyx_v_ret; + PyObject *__pyx_r; + char (*__pyx_1); + PyObject *__pyx_2 = 0; + static char *__pyx_argnames[] = {"model",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_model)) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_model); + __pyx_v_ret = Py_None; Py_INCREF(__pyx_v_ret); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":899 */ + __pyx_1 = PyString_AsString(__pyx_v_model); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(gp_abilities_list_lookup_model(((struct __pyx_obj_7gphoto2_abilities_list *)__pyx_v_self)->abilitiesList,__pyx_1)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; goto __pyx_L1;} + Py_DECREF(__pyx_v_ret); + __pyx_v_ret = __pyx_2; + __pyx_2 = 0; + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":900 */ + Py_INCREF(__pyx_v_ret); + __pyx_r = __pyx_v_ret; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.abilities_list.lookup_model"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_ret); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_model); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_14abilities_list_detect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_7gphoto2_14abilities_list_detect(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + struct __pyx_obj_7gphoto2_ports *__pyx_v_p = 0; + struct __pyx_obj_7gphoto2_cameraList *__pyx_v_l; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + static char *__pyx_argnames[] = {"p",0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_p)) return 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_p); + ((PyObject*)__pyx_v_l) = Py_None; Py_INCREF(((PyObject*)__pyx_v_l)); + if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p), __pyx_ptype_7gphoto2_ports, 1, "p")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; goto __pyx_L1;} + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":904 */ + __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_7gphoto2_cameraList), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_7gphoto2_cameraList)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_l)); + ((PyObject *)__pyx_v_l) = __pyx_2; + __pyx_2 = 0; + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":905 */ + __pyx_1 = PyInt_FromLong(gp_abilities_list_detect(((struct __pyx_obj_7gphoto2_abilities_list *)__pyx_v_self)->abilitiesList,__pyx_v_p->portInfoList,__pyx_v_l->liste,0)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":906 */ + Py_INCREF(((PyObject *)__pyx_v_l)); + __pyx_r = ((PyObject *)__pyx_v_l); + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.abilities_list.detect"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_l); + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_p); + return __pyx_r; +} + +static int __pyx_f_7gphoto2_6camera___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_f_7gphoto2_6camera___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + int __pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":912 */ + __pyx_1 = PyInt_FromLong(gp_camera_new((&((struct __pyx_obj_7gphoto2_camera *)__pyx_v_self)->camera))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.camera.__new__"); + __pyx_r = -1; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_6camera_init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_7gphoto2_6camera_init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":915 */ + __pyx_1 = PyInt_FromLong(gp_camera_init(((struct __pyx_obj_7gphoto2_camera *)__pyx_v_self)->camera,0)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.camera.init"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static void __pyx_f_7gphoto2_6camera___dealloc__(PyObject *__pyx_v_self); /*proto*/ +static void __pyx_f_7gphoto2_6camera___dealloc__(PyObject *__pyx_v_self) { + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":918 */ + __pyx_1 = PyInt_FromLong(gp_camera_free(((struct __pyx_obj_7gphoto2_camera *)__pyx_v_self)->camera)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.camera.__dealloc__"); + __pyx_L0:; + Py_DECREF(__pyx_v_self); +} + +static int __pyx_f_7gphoto2_6camera_9abilities___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_ab); /*proto*/ +static int __pyx_f_7gphoto2_6camera_9abilities___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_ab) { + int __pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + Py_INCREF(__pyx_v_self); + Py_INCREF(__pyx_v_ab); + if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ab), __pyx_ptype_7gphoto2_cameraAbilities, 1, "ab")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; goto __pyx_L1;} + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":922 */ + __pyx_1 = PyInt_FromLong(gp_camera_set_abilities(((struct __pyx_obj_7gphoto2_camera *)__pyx_v_self)->camera,((struct __pyx_obj_7gphoto2_cameraAbilities *)__pyx_v_ab)->abilitie)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + __pyx_r = 0; + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.camera.abilities.__set__"); + __pyx_r = -1; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + Py_DECREF(__pyx_v_ab); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_6camera_9abilities___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_7gphoto2_6camera_9abilities___get__(PyObject *__pyx_v_self) { + struct __pyx_obj_7gphoto2_cameraAbilities *__pyx_v_ab; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + Py_INCREF(__pyx_v_self); + ((PyObject*)__pyx_v_ab) = Py_None; Py_INCREF(((PyObject*)__pyx_v_ab)); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":925 */ + __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_7gphoto2_cameraAbilities), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_7gphoto2_cameraAbilities)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_v_ab)); + ((PyObject *)__pyx_v_ab) = __pyx_2; + __pyx_2 = 0; + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":926 */ + __pyx_1 = PyInt_FromLong(gp_camera_get_abilities(((struct __pyx_obj_7gphoto2_camera *)__pyx_v_self)->camera,(&__pyx_v_ab->abilitie))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":927 */ + Py_INCREF(((PyObject *)__pyx_v_ab)); + __pyx_r = ((PyObject *)__pyx_v_ab); + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.camera.abilities.__get__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_ab); + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_6camera_7summary___get__(PyObject *__pyx_v_self); /*proto*/ +static PyObject *__pyx_f_7gphoto2_6camera_7summary___get__(PyObject *__pyx_v_self) { + CameraText __pyx_v_txt; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":932 */ + __pyx_1 = PyInt_FromLong(gp_camera_get_summary(((struct __pyx_obj_7gphoto2_camera *)__pyx_v_self)->camera,(&__pyx_v_txt),0)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":933 */ + __pyx_1 = PyString_FromString(__pyx_v_txt.text); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} + __pyx_r = __pyx_1; + __pyx_1 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + __Pyx_AddTraceback("gphoto2.camera.summary.__get__"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static PyObject *__pyx_f_7gphoto2_6camera_capture_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static PyObject *__pyx_f_7gphoto2_6camera_capture_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + CameraFilePath __pyx_v_path; + PyObject *__pyx_r; + PyObject *__pyx_1 = 0; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + static char *__pyx_argnames[] = {0}; + if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; + Py_INCREF(__pyx_v_self); + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":937 */ + __pyx_1 = PyInt_FromLong(gp_camera_capture(((struct __pyx_obj_7gphoto2_camera *)__pyx_v_self)->camera,GP_CAPTURE_IMAGE,(&__pyx_v_path),0)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;} + __pyx_2 = __pyx_f_7gphoto2_check(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":938 */ + __pyx_1 = PyString_FromString(__pyx_v_path.folder); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;} + __pyx_2 = PyString_FromString(__pyx_v_path.name); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2); + __pyx_1 = 0; + __pyx_2 = 0; + __pyx_r = __pyx_3; + __pyx_3 = 0; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(__pyx_r); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_1); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + __Pyx_AddTraceback("gphoto2.camera.capture_image"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(__pyx_v_self); + return __pyx_r; +} + +static __Pyx_InternTabEntry __pyx_intern_tab[] = { + {&__pyx_n_Exception, "Exception"}, + {&__pyx_n_False, "False"}, + {&__pyx_n_str, "str"}, + {&__pyx_n_version, "version"}, + {0, 0} +}; + +static __Pyx_StringTabEntry __pyx_string_tab[] = { + {&__pyx_k2p, __pyx_k2, sizeof(__pyx_k2)}, + {&__pyx_k3p, __pyx_k3, sizeof(__pyx_k3)}, + {&__pyx_k4p, __pyx_k4, sizeof(__pyx_k4)}, + {0, 0, 0} +}; + +static PyObject *__pyx_tp_new_7gphoto2_portInfo(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = (*t->tp_alloc)(t, 0); + struct __pyx_obj_7gphoto2_portInfo *p = (struct __pyx_obj_7gphoto2_portInfo *)o; + return o; +} + +static void __pyx_tp_dealloc_7gphoto2_portInfo(PyObject *o) { + struct __pyx_obj_7gphoto2_portInfo *p = (struct __pyx_obj_7gphoto2_portInfo *)o; + (*o->ob_type->tp_free)(o); +} + +static int __pyx_tp_traverse_7gphoto2_portInfo(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_7gphoto2_portInfo *p = (struct __pyx_obj_7gphoto2_portInfo *)o; + return 0; +} + +static int __pyx_tp_clear_7gphoto2_portInfo(PyObject *o) { + struct __pyx_obj_7gphoto2_portInfo *p = (struct __pyx_obj_7gphoto2_portInfo *)o; + return 0; +} + +static struct PyMethodDef __pyx_methods_7gphoto2_portInfo[] = { + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_portInfo = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + 0, /*nb_divide*/ + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + 0, /*nb_coerce*/ + 0, /*nb_int*/ + 0, /*nb_long*/ + 0, /*nb_float*/ + 0, /*nb_oct*/ + 0, /*nb_hex*/ + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + 0, /*nb_inplace_divide*/ + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ +}; + +static PySequenceMethods __pyx_tp_as_sequence_portInfo = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_portInfo = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_portInfo = { + 0, /*bf_getreadbuffer*/ + 0, /*bf_getwritebuffer*/ + 0, /*bf_getsegcount*/ + 0, /*bf_getcharbuffer*/ +}; + +statichere PyTypeObject __pyx_type_7gphoto2_portInfo = { + PyObject_HEAD_INIT(0) + 0, /*ob_size*/ + "gphoto2.portInfo", /*tp_name*/ + sizeof(struct __pyx_obj_7gphoto2_portInfo), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_7gphoto2_portInfo, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + __pyx_f_7gphoto2_8portInfo___repr__, /*tp_repr*/ + &__pyx_tp_as_number_portInfo, /*tp_as_number*/ + &__pyx_tp_as_sequence_portInfo, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_portInfo, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_portInfo, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_7gphoto2_portInfo, /*tp_traverse*/ + __pyx_tp_clear_7gphoto2_portInfo, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_7gphoto2_portInfo, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_7gphoto2_portInfo, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ +}; + +static PyObject *__pyx_tp_new_7gphoto2_ports(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = (*t->tp_alloc)(t, 0); + struct __pyx_obj_7gphoto2_ports *p = (struct __pyx_obj_7gphoto2_ports *)o; + if (__pyx_f_7gphoto2_5ports___new__(o, a, k) < 0) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_7gphoto2_ports(PyObject *o) { + struct __pyx_obj_7gphoto2_ports *p = (struct __pyx_obj_7gphoto2_ports *)o; + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++o->ob_refcnt; + __pyx_f_7gphoto2_5ports___dealloc__(o); + if (PyErr_Occurred()) PyErr_WriteUnraisable(o); + --o->ob_refcnt; + PyErr_Restore(etype, eval, etb); + } + (*o->ob_type->tp_free)(o); +} + +static int __pyx_tp_traverse_7gphoto2_ports(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_7gphoto2_ports *p = (struct __pyx_obj_7gphoto2_ports *)o; + return 0; +} + +static int __pyx_tp_clear_7gphoto2_ports(PyObject *o) { + struct __pyx_obj_7gphoto2_ports *p = (struct __pyx_obj_7gphoto2_ports *)o; + return 0; +} +static PyObject *__pyx_sq_item_7gphoto2_ports(PyObject *o, int i) { + PyObject *r; + PyObject *x = PyInt_FromLong(i); if(!x) return 0; + r = o->ob_type->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static struct PyMethodDef __pyx_methods_7gphoto2_ports[] = { + {"load", (PyCFunction)__pyx_f_7gphoto2_5ports_load, METH_VARARGS|METH_KEYWORDS, 0}, + {"count", (PyCFunction)__pyx_f_7gphoto2_5ports_count, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_ports = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + 0, /*nb_divide*/ + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + 0, /*nb_coerce*/ + 0, /*nb_int*/ + 0, /*nb_long*/ + 0, /*nb_float*/ + 0, /*nb_oct*/ + 0, /*nb_hex*/ + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + 0, /*nb_inplace_divide*/ + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ +}; + +static PySequenceMethods __pyx_tp_as_sequence_ports = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_7gphoto2_ports, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_ports = { + 0, /*mp_length*/ + __pyx_f_7gphoto2_5ports___getitem__, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_ports = { + 0, /*bf_getreadbuffer*/ + 0, /*bf_getwritebuffer*/ + 0, /*bf_getsegcount*/ + 0, /*bf_getcharbuffer*/ +}; + +statichere PyTypeObject __pyx_type_7gphoto2_ports = { + PyObject_HEAD_INIT(0) + 0, /*ob_size*/ + "gphoto2.ports", /*tp_name*/ + sizeof(struct __pyx_obj_7gphoto2_ports), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_7gphoto2_ports, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + 0, /*tp_repr*/ + &__pyx_tp_as_number_ports, /*tp_as_number*/ + &__pyx_tp_as_sequence_ports, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_ports, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_ports, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_7gphoto2_ports, /*tp_traverse*/ + __pyx_tp_clear_7gphoto2_ports, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_7gphoto2_ports, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_7gphoto2_ports, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ +}; + +static PyObject *__pyx_tp_new_7gphoto2_cameraList(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = (*t->tp_alloc)(t, 0); + struct __pyx_obj_7gphoto2_cameraList *p = (struct __pyx_obj_7gphoto2_cameraList *)o; + if (__pyx_f_7gphoto2_10cameraList___new__(o, a, k) < 0) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_7gphoto2_cameraList(PyObject *o) { + struct __pyx_obj_7gphoto2_cameraList *p = (struct __pyx_obj_7gphoto2_cameraList *)o; + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++o->ob_refcnt; + __pyx_f_7gphoto2_10cameraList___dealloc__(o); + if (PyErr_Occurred()) PyErr_WriteUnraisable(o); + --o->ob_refcnt; + PyErr_Restore(etype, eval, etb); + } + (*o->ob_type->tp_free)(o); +} + +static int __pyx_tp_traverse_7gphoto2_cameraList(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_7gphoto2_cameraList *p = (struct __pyx_obj_7gphoto2_cameraList *)o; + return 0; +} + +static int __pyx_tp_clear_7gphoto2_cameraList(PyObject *o) { + struct __pyx_obj_7gphoto2_cameraList *p = (struct __pyx_obj_7gphoto2_cameraList *)o; + return 0; +} +static PyObject *__pyx_sq_item_7gphoto2_cameraList(PyObject *o, int i) { + PyObject *r; + PyObject *x = PyInt_FromLong(i); if(!x) return 0; + r = o->ob_type->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static struct PyMethodDef __pyx_methods_7gphoto2_cameraList[] = { + {"count", (PyCFunction)__pyx_f_7gphoto2_10cameraList_count, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_cameraList = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + 0, /*nb_divide*/ + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + 0, /*nb_coerce*/ + 0, /*nb_int*/ + 0, /*nb_long*/ + 0, /*nb_float*/ + 0, /*nb_oct*/ + 0, /*nb_hex*/ + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + 0, /*nb_inplace_divide*/ + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ +}; + +static PySequenceMethods __pyx_tp_as_sequence_cameraList = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_7gphoto2_cameraList, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_cameraList = { + 0, /*mp_length*/ + __pyx_f_7gphoto2_10cameraList___getitem__, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_cameraList = { + 0, /*bf_getreadbuffer*/ + 0, /*bf_getwritebuffer*/ + 0, /*bf_getsegcount*/ + 0, /*bf_getcharbuffer*/ +}; + +statichere PyTypeObject __pyx_type_7gphoto2_cameraList = { + PyObject_HEAD_INIT(0) + 0, /*ob_size*/ + "gphoto2.cameraList", /*tp_name*/ + sizeof(struct __pyx_obj_7gphoto2_cameraList), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_7gphoto2_cameraList, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + 0, /*tp_repr*/ + &__pyx_tp_as_number_cameraList, /*tp_as_number*/ + &__pyx_tp_as_sequence_cameraList, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_cameraList, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_cameraList, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_7gphoto2_cameraList, /*tp_traverse*/ + __pyx_tp_clear_7gphoto2_cameraList, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_7gphoto2_cameraList, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_7gphoto2_cameraList, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ +}; + +static PyObject *__pyx_tp_new_7gphoto2_cameraAbilities(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = (*t->tp_alloc)(t, 0); + struct __pyx_obj_7gphoto2_cameraAbilities *p = (struct __pyx_obj_7gphoto2_cameraAbilities *)o; + if (__pyx_f_7gphoto2_15cameraAbilities___new__(o, a, k) < 0) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_7gphoto2_cameraAbilities(PyObject *o) { + struct __pyx_obj_7gphoto2_cameraAbilities *p = (struct __pyx_obj_7gphoto2_cameraAbilities *)o; + (*o->ob_type->tp_free)(o); +} + +static int __pyx_tp_traverse_7gphoto2_cameraAbilities(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_7gphoto2_cameraAbilities *p = (struct __pyx_obj_7gphoto2_cameraAbilities *)o; + return 0; +} + +static int __pyx_tp_clear_7gphoto2_cameraAbilities(PyObject *o) { + struct __pyx_obj_7gphoto2_cameraAbilities *p = (struct __pyx_obj_7gphoto2_cameraAbilities *)o; + return 0; +} + +static PyObject *__pyx_getprop_7gphoto2_15cameraAbilities_model(PyObject *o, void *x) { + return __pyx_f_7gphoto2_15cameraAbilities_5model___get__(o); +} + +static PyObject *__pyx_getprop_7gphoto2_15cameraAbilities_status(PyObject *o, void *x) { + return __pyx_f_7gphoto2_15cameraAbilities_6status___get__(o); +} + +static PyObject *__pyx_getprop_7gphoto2_15cameraAbilities_port(PyObject *o, void *x) { + return __pyx_f_7gphoto2_15cameraAbilities_4port___get__(o); +} + +static PyObject *__pyx_getprop_7gphoto2_15cameraAbilities_operations(PyObject *o, void *x) { + return __pyx_f_7gphoto2_15cameraAbilities_10operations___get__(o); +} + +static PyObject *__pyx_getprop_7gphoto2_15cameraAbilities_file_operations(PyObject *o, void *x) { + return __pyx_f_7gphoto2_15cameraAbilities_15file_operations___get__(o); +} + +static PyObject *__pyx_getprop_7gphoto2_15cameraAbilities_folder_operations(PyObject *o, void *x) { + return __pyx_f_7gphoto2_15cameraAbilities_17folder_operations___get__(o); +} + +static PyObject *__pyx_getprop_7gphoto2_15cameraAbilities_usb_vendor(PyObject *o, void *x) { + return __pyx_f_7gphoto2_15cameraAbilities_10usb_vendor___get__(o); +} + +static PyObject *__pyx_getprop_7gphoto2_15cameraAbilities_usb_product(PyObject *o, void *x) { + return __pyx_f_7gphoto2_15cameraAbilities_11usb_product___get__(o); +} + +static PyObject *__pyx_getprop_7gphoto2_15cameraAbilities_usb_class(PyObject *o, void *x) { + return __pyx_f_7gphoto2_15cameraAbilities_9usb_class___get__(o); +} + +static PyObject *__pyx_getprop_7gphoto2_15cameraAbilities_usb_subclass(PyObject *o, void *x) { + return __pyx_f_7gphoto2_15cameraAbilities_12usb_subclass___get__(o); +} + +static PyObject *__pyx_getprop_7gphoto2_15cameraAbilities_usb_protocol(PyObject *o, void *x) { + return __pyx_f_7gphoto2_15cameraAbilities_12usb_protocol___get__(o); +} + +static PyObject *__pyx_getprop_7gphoto2_15cameraAbilities_library(PyObject *o, void *x) { + return __pyx_f_7gphoto2_15cameraAbilities_7library___get__(o); +} + +static PyObject *__pyx_getprop_7gphoto2_15cameraAbilities_id(PyObject *o, void *x) { + return __pyx_f_7gphoto2_15cameraAbilities_2id___get__(o); +} + +static struct PyMethodDef __pyx_methods_7gphoto2_cameraAbilities[] = { + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_7gphoto2_cameraAbilities[] = { + {"model", __pyx_getprop_7gphoto2_15cameraAbilities_model, 0, 0, 0}, + {"status", __pyx_getprop_7gphoto2_15cameraAbilities_status, 0, 0, 0}, + {"port", __pyx_getprop_7gphoto2_15cameraAbilities_port, 0, 0, 0}, + {"operations", __pyx_getprop_7gphoto2_15cameraAbilities_operations, 0, 0, 0}, + {"file_operations", __pyx_getprop_7gphoto2_15cameraAbilities_file_operations, 0, 0, 0}, + {"folder_operations", __pyx_getprop_7gphoto2_15cameraAbilities_folder_operations, 0, 0, 0}, + {"usb_vendor", __pyx_getprop_7gphoto2_15cameraAbilities_usb_vendor, 0, 0, 0}, + {"usb_product", __pyx_getprop_7gphoto2_15cameraAbilities_usb_product, 0, 0, 0}, + {"usb_class", __pyx_getprop_7gphoto2_15cameraAbilities_usb_class, 0, 0, 0}, + {"usb_subclass", __pyx_getprop_7gphoto2_15cameraAbilities_usb_subclass, 0, 0, 0}, + {"usb_protocol", __pyx_getprop_7gphoto2_15cameraAbilities_usb_protocol, 0, 0, 0}, + {"library", __pyx_getprop_7gphoto2_15cameraAbilities_library, 0, 0, 0}, + {"id", __pyx_getprop_7gphoto2_15cameraAbilities_id, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_cameraAbilities = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + 0, /*nb_divide*/ + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + 0, /*nb_coerce*/ + 0, /*nb_int*/ + 0, /*nb_long*/ + 0, /*nb_float*/ + 0, /*nb_oct*/ + 0, /*nb_hex*/ + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + 0, /*nb_inplace_divide*/ + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ +}; + +static PySequenceMethods __pyx_tp_as_sequence_cameraAbilities = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_cameraAbilities = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_cameraAbilities = { + 0, /*bf_getreadbuffer*/ + 0, /*bf_getwritebuffer*/ + 0, /*bf_getsegcount*/ + 0, /*bf_getcharbuffer*/ +}; + +statichere PyTypeObject __pyx_type_7gphoto2_cameraAbilities = { + PyObject_HEAD_INIT(0) + 0, /*ob_size*/ + "gphoto2.cameraAbilities", /*tp_name*/ + sizeof(struct __pyx_obj_7gphoto2_cameraAbilities), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_7gphoto2_cameraAbilities, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + __pyx_f_7gphoto2_15cameraAbilities___repr__, /*tp_repr*/ + &__pyx_tp_as_number_cameraAbilities, /*tp_as_number*/ + &__pyx_tp_as_sequence_cameraAbilities, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_cameraAbilities, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_cameraAbilities, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_7gphoto2_cameraAbilities, /*tp_traverse*/ + __pyx_tp_clear_7gphoto2_cameraAbilities, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_7gphoto2_cameraAbilities, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_7gphoto2_cameraAbilities, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_7gphoto2_cameraAbilities, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ +}; + +static PyObject *__pyx_tp_new_7gphoto2_abilities_list(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = (*t->tp_alloc)(t, 0); + struct __pyx_obj_7gphoto2_abilities_list *p = (struct __pyx_obj_7gphoto2_abilities_list *)o; + if (__pyx_f_7gphoto2_14abilities_list___new__(o, a, k) < 0) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_7gphoto2_abilities_list(PyObject *o) { + struct __pyx_obj_7gphoto2_abilities_list *p = (struct __pyx_obj_7gphoto2_abilities_list *)o; + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++o->ob_refcnt; + __pyx_f_7gphoto2_14abilities_list___dealloc__(o); + if (PyErr_Occurred()) PyErr_WriteUnraisable(o); + --o->ob_refcnt; + PyErr_Restore(etype, eval, etb); + } + (*o->ob_type->tp_free)(o); +} + +static int __pyx_tp_traverse_7gphoto2_abilities_list(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_7gphoto2_abilities_list *p = (struct __pyx_obj_7gphoto2_abilities_list *)o; + return 0; +} + +static int __pyx_tp_clear_7gphoto2_abilities_list(PyObject *o) { + struct __pyx_obj_7gphoto2_abilities_list *p = (struct __pyx_obj_7gphoto2_abilities_list *)o; + return 0; +} +static PyObject *__pyx_sq_item_7gphoto2_abilities_list(PyObject *o, int i) { + PyObject *r; + PyObject *x = PyInt_FromLong(i); if(!x) return 0; + r = o->ob_type->tp_as_mapping->mp_subscript(o, x); + Py_DECREF(x); + return r; +} + +static struct PyMethodDef __pyx_methods_7gphoto2_abilities_list[] = { + {"count", (PyCFunction)__pyx_f_7gphoto2_14abilities_list_count, METH_VARARGS|METH_KEYWORDS, 0}, + {"load", (PyCFunction)__pyx_f_7gphoto2_14abilities_list_load, METH_VARARGS|METH_KEYWORDS, 0}, + {"lookup_model", (PyCFunction)__pyx_f_7gphoto2_14abilities_list_lookup_model, METH_VARARGS|METH_KEYWORDS, 0}, + {"detect", (PyCFunction)__pyx_f_7gphoto2_14abilities_list_detect, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_abilities_list = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + 0, /*nb_divide*/ + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + 0, /*nb_coerce*/ + 0, /*nb_int*/ + 0, /*nb_long*/ + 0, /*nb_float*/ + 0, /*nb_oct*/ + 0, /*nb_hex*/ + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + 0, /*nb_inplace_divide*/ + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ +}; + +static PySequenceMethods __pyx_tp_as_sequence_abilities_list = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + __pyx_sq_item_7gphoto2_abilities_list, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_abilities_list = { + 0, /*mp_length*/ + __pyx_f_7gphoto2_14abilities_list___getitem__, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_abilities_list = { + 0, /*bf_getreadbuffer*/ + 0, /*bf_getwritebuffer*/ + 0, /*bf_getsegcount*/ + 0, /*bf_getcharbuffer*/ +}; + +statichere PyTypeObject __pyx_type_7gphoto2_abilities_list = { + PyObject_HEAD_INIT(0) + 0, /*ob_size*/ + "gphoto2.abilities_list", /*tp_name*/ + sizeof(struct __pyx_obj_7gphoto2_abilities_list), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_7gphoto2_abilities_list, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + 0, /*tp_repr*/ + &__pyx_tp_as_number_abilities_list, /*tp_as_number*/ + &__pyx_tp_as_sequence_abilities_list, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_abilities_list, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_abilities_list, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_7gphoto2_abilities_list, /*tp_traverse*/ + __pyx_tp_clear_7gphoto2_abilities_list, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_7gphoto2_abilities_list, /*tp_methods*/ + 0, /*tp_members*/ + 0, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_7gphoto2_abilities_list, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ +}; + +static PyObject *__pyx_tp_new_7gphoto2_camera(PyTypeObject *t, PyObject *a, PyObject *k) { + PyObject *o = (*t->tp_alloc)(t, 0); + struct __pyx_obj_7gphoto2_camera *p = (struct __pyx_obj_7gphoto2_camera *)o; + if (__pyx_f_7gphoto2_6camera___new__(o, a, k) < 0) { + Py_DECREF(o); o = 0; + } + return o; +} + +static void __pyx_tp_dealloc_7gphoto2_camera(PyObject *o) { + struct __pyx_obj_7gphoto2_camera *p = (struct __pyx_obj_7gphoto2_camera *)o; + { + PyObject *etype, *eval, *etb; + PyErr_Fetch(&etype, &eval, &etb); + ++o->ob_refcnt; + __pyx_f_7gphoto2_6camera___dealloc__(o); + if (PyErr_Occurred()) PyErr_WriteUnraisable(o); + --o->ob_refcnt; + PyErr_Restore(etype, eval, etb); + } + (*o->ob_type->tp_free)(o); +} + +static int __pyx_tp_traverse_7gphoto2_camera(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_7gphoto2_camera *p = (struct __pyx_obj_7gphoto2_camera *)o; + return 0; +} + +static int __pyx_tp_clear_7gphoto2_camera(PyObject *o) { + struct __pyx_obj_7gphoto2_camera *p = (struct __pyx_obj_7gphoto2_camera *)o; + return 0; +} + +static PyObject *__pyx_getprop_7gphoto2_6camera_abilities(PyObject *o, void *x) { + return __pyx_f_7gphoto2_6camera_9abilities___get__(o); +} + +static int __pyx_setprop_7gphoto2_6camera_abilities(PyObject *o, PyObject *v, void *x) { + if (v) { + return __pyx_f_7gphoto2_6camera_9abilities___set__(o, v); + } + else { + PyErr_SetString(PyExc_NotImplementedError, "__del__"); + return -1; + } +} + +static PyObject *__pyx_getprop_7gphoto2_6camera_summary(PyObject *o, void *x) { + return __pyx_f_7gphoto2_6camera_7summary___get__(o); +} + +static struct PyMethodDef __pyx_methods_7gphoto2_camera[] = { + {"init", (PyCFunction)__pyx_f_7gphoto2_6camera_init, METH_VARARGS|METH_KEYWORDS, 0}, + {"capture_image", (PyCFunction)__pyx_f_7gphoto2_6camera_capture_image, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +static struct PyGetSetDef __pyx_getsets_7gphoto2_camera[] = { + {"abilities", __pyx_getprop_7gphoto2_6camera_abilities, __pyx_setprop_7gphoto2_6camera_abilities, 0, 0}, + {"summary", __pyx_getprop_7gphoto2_6camera_summary, 0, 0, 0}, + {0, 0, 0, 0, 0} +}; + +static PyNumberMethods __pyx_tp_as_number_camera = { + 0, /*nb_add*/ + 0, /*nb_subtract*/ + 0, /*nb_multiply*/ + 0, /*nb_divide*/ + 0, /*nb_remainder*/ + 0, /*nb_divmod*/ + 0, /*nb_power*/ + 0, /*nb_negative*/ + 0, /*nb_positive*/ + 0, /*nb_absolute*/ + 0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + 0, /*nb_coerce*/ + 0, /*nb_int*/ + 0, /*nb_long*/ + 0, /*nb_float*/ + 0, /*nb_oct*/ + 0, /*nb_hex*/ + 0, /*nb_inplace_add*/ + 0, /*nb_inplace_subtract*/ + 0, /*nb_inplace_multiply*/ + 0, /*nb_inplace_divide*/ + 0, /*nb_inplace_remainder*/ + 0, /*nb_inplace_power*/ + 0, /*nb_inplace_lshift*/ + 0, /*nb_inplace_rshift*/ + 0, /*nb_inplace_and*/ + 0, /*nb_inplace_xor*/ + 0, /*nb_inplace_or*/ + 0, /*nb_floor_divide*/ + 0, /*nb_true_divide*/ + 0, /*nb_inplace_floor_divide*/ + 0, /*nb_inplace_true_divide*/ +}; + +static PySequenceMethods __pyx_tp_as_sequence_camera = { + 0, /*sq_length*/ + 0, /*sq_concat*/ + 0, /*sq_repeat*/ + 0, /*sq_item*/ + 0, /*sq_slice*/ + 0, /*sq_ass_item*/ + 0, /*sq_ass_slice*/ + 0, /*sq_contains*/ + 0, /*sq_inplace_concat*/ + 0, /*sq_inplace_repeat*/ +}; + +static PyMappingMethods __pyx_tp_as_mapping_camera = { + 0, /*mp_length*/ + 0, /*mp_subscript*/ + 0, /*mp_ass_subscript*/ +}; + +static PyBufferProcs __pyx_tp_as_buffer_camera = { + 0, /*bf_getreadbuffer*/ + 0, /*bf_getwritebuffer*/ + 0, /*bf_getsegcount*/ + 0, /*bf_getcharbuffer*/ +}; + +statichere PyTypeObject __pyx_type_7gphoto2_camera = { + PyObject_HEAD_INIT(0) + 0, /*ob_size*/ + "gphoto2.camera", /*tp_name*/ + sizeof(struct __pyx_obj_7gphoto2_camera), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_7gphoto2_camera, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + 0, /*tp_repr*/ + &__pyx_tp_as_number_camera, /*tp_as_number*/ + &__pyx_tp_as_sequence_camera, /*tp_as_sequence*/ + &__pyx_tp_as_mapping_camera, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + &__pyx_tp_as_buffer_camera, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_7gphoto2_camera, /*tp_traverse*/ + __pyx_tp_clear_7gphoto2_camera, /*tp_clear*/ + 0, /*tp_richcompare*/ + 0, /*tp_weaklistoffset*/ + 0, /*tp_iter*/ + 0, /*tp_iternext*/ + __pyx_methods_7gphoto2_camera, /*tp_methods*/ + 0, /*tp_members*/ + __pyx_getsets_7gphoto2_camera, /*tp_getset*/ + 0, /*tp_base*/ + 0, /*tp_dict*/ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_7gphoto2_camera, /*tp_new*/ + 0, /*tp_free*/ + 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ +}; + +static struct PyMethodDef __pyx_methods[] = { + {"version", (PyCFunction)__pyx_f_7gphoto2_version, METH_VARARGS|METH_KEYWORDS, 0}, + {0, 0, 0, 0} +}; + +DL_EXPORT(void) initgphoto2(void); /*proto*/ +DL_EXPORT(void) initgphoto2(void) { + PyObject *__pyx_1 = 0; + __pyx_m = Py_InitModule4("gphoto2", __pyx_methods, 0, 0, PYTHON_API_VERSION); + if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}; + __pyx_b = PyImport_AddModule("__builtin__"); + if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}; + if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}; + if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}; + if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}; + if (PyType_Ready(&__pyx_type_7gphoto2_portInfo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "portInfo", (PyObject *)&__pyx_type_7gphoto2_portInfo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;} + __pyx_ptype_7gphoto2_portInfo = &__pyx_type_7gphoto2_portInfo; + if (PyType_Ready(&__pyx_type_7gphoto2_ports) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "ports", (PyObject *)&__pyx_type_7gphoto2_ports) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; goto __pyx_L1;} + __pyx_ptype_7gphoto2_ports = &__pyx_type_7gphoto2_ports; + if (PyType_Ready(&__pyx_type_7gphoto2_cameraList) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "cameraList", (PyObject *)&__pyx_type_7gphoto2_cameraList) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; goto __pyx_L1;} + __pyx_ptype_7gphoto2_cameraList = &__pyx_type_7gphoto2_cameraList; + if (PyType_Ready(&__pyx_type_7gphoto2_cameraAbilities) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "cameraAbilities", (PyObject *)&__pyx_type_7gphoto2_cameraAbilities) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;} + __pyx_ptype_7gphoto2_cameraAbilities = &__pyx_type_7gphoto2_cameraAbilities; + if (PyType_Ready(&__pyx_type_7gphoto2_abilities_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "abilities_list", (PyObject *)&__pyx_type_7gphoto2_abilities_list) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;} + __pyx_ptype_7gphoto2_abilities_list = &__pyx_type_7gphoto2_abilities_list; + if (PyType_Ready(&__pyx_type_7gphoto2_camera) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "camera", (PyObject *)&__pyx_type_7gphoto2_camera) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; goto __pyx_L1;} + __pyx_ptype_7gphoto2_camera = &__pyx_type_7gphoto2_camera; + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":757 */ + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_False); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; goto __pyx_L1;} + __pyx_k1 = __pyx_1; + __pyx_1 = 0; + + /* "/home/david/Desktop/gphoto2/dist/gphoto2.pyx":935 */ + return; + __pyx_L1:; + Py_XDECREF(__pyx_1); + __Pyx_AddTraceback("gphoto2"); +} + +static char *__pyx_filenames[] = { + "gphoto2.pyx", +}; +statichere char **__pyx_f = __pyx_filenames; + +/* Runtime support code */ + +static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name) { + if (!type) { + PyErr_Format(PyExc_SystemError, "Missing type object"); + return 0; + } + if ((none_allowed && obj == Py_None) || PyObject_TypeCheck(obj, type)) + return 1; + PyErr_Format(PyExc_TypeError, + "Argument '%s' has incorrect type (expected %s, got %s)", + name, type->tp_name, obj->ob_type->tp_name); + return 0; +} + +static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { + PyObject *result; + result = PyObject_GetAttr(dict, name); + if (!result) + PyErr_SetObject(PyExc_NameError, name); + return result; +} + +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { + Py_XINCREF(type); + Py_XINCREF(value); + Py_XINCREF(tb); + /* First, check the traceback argument, replacing None with NULL. */ + if (tb == Py_None) { + Py_DECREF(tb); + tb = 0; + } + else if (tb != NULL && !PyTraceBack_Check(tb)) { + PyErr_SetString(PyExc_TypeError, + "raise: arg 3 must be a traceback or None"); + goto raise_error; + } + /* Next, replace a missing value with None */ + if (value == NULL) { + value = Py_None; + Py_INCREF(value); + } + /* Next, repeatedly, replace a tuple exception with its first item */ + while (PyTuple_Check(type) && PyTuple_Size(type) > 0) { + PyObject *tmp = type; + type = PyTuple_GET_ITEM(type, 0); + Py_INCREF(type); + Py_DECREF(tmp); + } + if (PyString_Check(type)) + ; + else if (PyClass_Check(type)) + ; /*PyErr_NormalizeException(&type, &value, &tb);*/ + else if (PyInstance_Check(type)) { + /* Raising an instance. The value should be a dummy. */ + if (value != Py_None) { + PyErr_SetString(PyExc_TypeError, + "instance exception may not have a separate value"); + goto raise_error; + } + else { + /* Normalize to raise , */ + Py_DECREF(value); + value = type; + type = (PyObject*) ((PyInstanceObject*)type)->in_class; + Py_INCREF(type); + } + } + else { + /* Not something you can raise. You get an exception + anyway, just not what you specified :-) */ + PyErr_Format(PyExc_TypeError, + "exceptions must be strings, classes, or " + "instances, not %s", type->ob_type->tp_name); + goto raise_error; + } + PyErr_Restore(type, value, tb); + return; +raise_error: + Py_XDECREF(value); + Py_XDECREF(type); + Py_XDECREF(tb); + return; +} + +static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (!type) { + PyErr_Format(PyExc_SystemError, "Missing type object"); + return 0; + } + if (obj == Py_None || PyObject_TypeCheck(obj, type)) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s", + obj->ob_type->tp_name, type->tp_name); + return 0; +} + +static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) { + while (t->p) { + *t->p = PyString_InternFromString(t->s); + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + *t->p = PyString_FromStringAndSize(t->s, t->n - 1); + if (!*t->p) + return -1; + ++t; + } + return 0; +} + +#include "compile.h" +#include "frameobject.h" +#include "traceback.h" + +static void __Pyx_AddTraceback(char *funcname) { + PyObject *py_srcfile = 0; + PyObject *py_funcname = 0; + PyObject *py_globals = 0; + PyObject *empty_tuple = 0; + PyObject *empty_string = 0; + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; + + py_srcfile = PyString_FromString(__pyx_filename); + if (!py_srcfile) goto bad; + py_funcname = PyString_FromString(funcname); + if (!py_funcname) goto bad; + py_globals = PyModule_GetDict(__pyx_m); + if (!py_globals) goto bad; + empty_tuple = PyTuple_New(0); + if (!empty_tuple) goto bad; + empty_string = PyString_FromString(""); + if (!empty_string) goto bad; + py_code = PyCode_New( + 0, /*int argcount,*/ + 0, /*int nlocals,*/ + 0, /*int stacksize,*/ + 0, /*int flags,*/ + empty_string, /*PyObject *code,*/ + empty_tuple, /*PyObject *consts,*/ + empty_tuple, /*PyObject *names,*/ + empty_tuple, /*PyObject *varnames,*/ + empty_tuple, /*PyObject *freevars,*/ + empty_tuple, /*PyObject *cellvars,*/ + py_srcfile, /*PyObject *filename,*/ + py_funcname, /*PyObject *name,*/ + __pyx_lineno, /*int firstlineno,*/ + empty_string /*PyObject *lnotab*/ + ); + if (!py_code) goto bad; + py_frame = PyFrame_New( + PyThreadState_Get(), /*PyThreadState *tstate,*/ + py_code, /*PyCodeObject *code,*/ + py_globals, /*PyObject *globals,*/ + 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; + py_frame->f_lineno = __pyx_lineno; + PyTraceBack_Here(py_frame); +bad: + Py_XDECREF(py_srcfile); + Py_XDECREF(py_funcname); + Py_XDECREF(empty_tuple); + Py_XDECREF(empty_string); + Py_XDECREF(py_code); + Py_XDECREF(py_frame); +} diff --git a/bindings/python/gphoto2.pyx b/bindings/python/gphoto2.pyx new file mode 100644 index 000000000..c31dae1eb --- /dev/null +++ b/bindings/python/gphoto2.pyx @@ -0,0 +1,938 @@ +# Copyright (C) 2003-2004 David PHAM-VAN -- david@ab2r.com +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +#------------------------------------------------------------------------------ + +cdef extern from "time.h": + ctypedef struct time_t: + int a + +#------------------------------------------------------------------------------ + +cdef extern from "gphoto2-port-version.h": + + ctypedef enum GPVersionVerbosity: + GP_VERSION_SHORT + GP_VERSION_VERBOSE + + char **gp_port_library_version(GPVersionVerbosity verbose) + +#------------------------------------------------------------------------------ + +cdef extern from "gphoto2-version.h": + char **gp_library_version(GPVersionVerbosity verbose) + +#------------------------------------------------------------------------------ + +cdef extern from "gphoto2-context.h": + ctypedef struct GPContext + + GPContext *gp_context_new () + + void gp_context_ref (GPContext *context) + void gp_context_unref (GPContext *context) + + ctypedef enum GPContextFeedback: + GP_CONTEXT_FEEDBACK_OK + GP_CONTEXT_FEEDBACK_CANCEL + + ctypedef void (* GPContextIdleFunc) (GPContext *context, void *data) + ctypedef void (* GPContextErrorFunc) (GPContext *context, char *format, args, void *data) + ctypedef void (* GPContextStatusFunc) (GPContext *context, char *format, args, void *data) + ctypedef void (* GPContextMessageFunc) (GPContext *context, char *format, args, void *data) + ctypedef GPContextFeedback (* GPContextQuestionFunc) (GPContext *context, char *format, args, void *data) + ctypedef GPContextFeedback (* GPContextCancelFunc) (GPContext *context, void *data) + ctypedef unsigned int (* GPContextProgressStartFunc) (GPContext *context, float target, char *format, args, void *data) + ctypedef void (* GPContextProgressUpdateFunc) (GPContext *context, unsigned int id, float current, void *data) + ctypedef void (* GPContextProgressStopFunc) (GPContext *context, unsigned int id, void *data) + + void gp_context_set_idle_func (GPContext *context, GPContextIdleFunc func, void *data) + void gp_context_set_progress_funcs (GPContext *context, GPContextProgressStartFunc start_func, GPContextProgressUpdateFunc update_func, + GPContextProgressStopFunc stop_func, void *data) + void gp_context_set_error_func (GPContext *context, GPContextErrorFunc func, void *data) + void gp_context_set_status_func (GPContext *context, GPContextStatusFunc func, void *data) + void gp_context_set_question_func (GPContext *context, GPContextQuestionFunc func, void *data) + void gp_context_set_cancel_func (GPContext *context, GPContextCancelFunc func, void *data) + void gp_context_set_message_func (GPContext *context, GPContextMessageFunc func, void *data) + + void gp_context_idle (GPContext *context) + void gp_context_error (GPContext *context, char *format, ...) + + void gp_context_status (GPContext *context, char *format, ...) + void gp_context_message (GPContext *context, char *format, ...) + + GPContextFeedback gp_context_question (GPContext *context, char *format, ...) + GPContextFeedback gp_context_cancel (GPContext *context) + unsigned int gp_context_progress_start (GPContext *context, float target, char *format, ...) + + void gp_context_progress_update (GPContext *context, unsigned int id, float current) + void gp_context_progress_stop (GPContext *context, unsigned int id) + +#------------------------------------------------------------------------------ + +cdef extern from "gphoto2-port-info-list.h": + ctypedef enum GPPortType: + GP_PORT_NONE + GP_PORT_SERIAL + GP_PORT_USB + + ctypedef struct GPPortInfo: + GPPortType type + char name[64] + char path[64] + char library_filename[1024] + + ctypedef struct GPPortInfoList + + int gp_port_info_list_new (GPPortInfoList **list) + int gp_port_info_list_free (GPPortInfoList *list) + + int gp_port_info_list_append (GPPortInfoList *list, GPPortInfo info) + + int gp_port_info_list_load (GPPortInfoList *list) + + int gp_port_info_list_count (GPPortInfoList *list) + + int gp_port_info_list_lookup_path (GPPortInfoList *list, char *path) + int gp_port_info_list_lookup_name (GPPortInfoList *list, char *name) + + int gp_port_info_list_get_info (GPPortInfoList *list, int n, GPPortInfo *info) + +#------------------------------------------------------------------------------ + +cdef extern from "gphoto2-port.h": + + ctypedef enum GPPortSerialParity: + GP_PORT_SERIAL_PARITY_OFF + GP_PORT_SERIAL_PARITY_EVEN + GP_PORT_SERIAL_PARITY_ODD + + ctypedef enum defines_port: + GP_PORT_MAX_BUF_LEN + + ctypedef struct GPPortSettingsSerial: + char port[128] + int speed + int bits + GPPortSerialParity parity + int stopbits + + ctypedef struct GPPortSettingsUSB: + int inep, outep, intep + int config + int interface + int altsetting + char port[64] + + ctypedef union GPPortSettings: + GPPortSettingsSerial serial + GPPortSettingsUSB usb + + enum: + GP_PORT_USB_ENDPOINT_IN + GP_PORT_USB_ENDPOINT_OUT + GP_PORT_USB_ENDPOINT_INT + + ctypedef struct GPPortPrivateLibrary + ctypedef struct GPPortPrivateCore + + ctypedef struct GPPort: + GPPortType type + GPPortSettings settings + GPPortSettings settings_pending + int timeout + GPPortPrivateLibrary *pl + GPPortPrivateCore *pc + + int gp_port_new (GPPort **port) + int gp_port_free (GPPort *port) + + int gp_port_set_info (GPPort *port, GPPortInfo info) + int gp_port_get_info (GPPort *port, GPPortInfo *info) + + int gp_port_open (GPPort *port) + int gp_port_close (GPPort *port) + + int gp_port_write (GPPort *port, char *data, int size) + int gp_port_read (GPPort *port, char *data, int size) + int gp_port_check_int (GPPort *port, char *data, int size) + int gp_port_check_int_fast (GPPort *port, char *data, int size) + + int gp_port_get_timeout (GPPort *port, int *timeout) + int gp_port_set_timeout (GPPort *port, int timeout) + + int gp_port_set_settings (GPPort *port, GPPortSettings settings) + int gp_port_get_settings (GPPort *port, GPPortSettings *settings) + + ctypedef enum GPPin: + GP_PIN_RTS + GP_PIN_DTR + GP_PIN_CTS + GP_PIN_DSR + GP_PIN_CD + GP_PIN_RING + + ctypedef enum GPLevel: + GP_LEVEL_LOW + GP_LEVEL_HIGH + + int gp_port_get_pin (GPPort *port, GPPin pin, GPLevel *level) + int gp_port_set_pin (GPPort *port, GPPin pin, GPLevel level) + + int gp_port_send_break (GPPort *port, int duration) + int gp_port_flush (GPPort *port, int direction) + + int gp_port_usb_find_device (GPPort *port, int idvendor, int idproduct) + int gp_port_usb_find_device_by_class (GPPort *port, int mainclass, int subclass, int protocol) + int gp_port_usb_clear_halt (GPPort *port, int ep) + int gp_port_usb_msg_write (GPPort *port, int request, int value, int index, char *bytes, int size) + int gp_port_usb_msg_read (GPPort *port, int request, int value, int index, char *bytes, int size) + int gp_port_set_error (GPPort *port, char *format, ...) + char *gp_port_get_error (GPPort *port) + +#------------------------------------------------------------------------------ + +cdef extern from "gphoto2-port-log.h": + ctypedef enum GPLogLevel: + GP_LOG_ERROR + GP_LOG_VERBOSE + GP_LOG_DEBUG + GP_LOG_DATA + + ctypedef void *GPLogFunc (GPLogLevel level, char *domain, char *format, args, void *data) + + int gp_log_add_func (GPLogLevel level, GPLogFunc func, void *data) + int gp_log_remove_func (int id) + + void gp_log (GPLogLevel level, char *domain, char *format, ...) + void gp_logv (GPLogLevel level, char *domain, char *format, args) + void gp_log_data (char *domain, char *data, unsigned int size) + +#------------------------------------------------------------------------------ + +cdef extern from "gphoto2-port-result.h": + ctypedef enum port_result: + GP_OK + GP_ERROR + GP_ERROR_BAD_PARAMETERS + GP_ERROR_NO_MEMORY + GP_ERROR_LIBRARY + GP_ERROR_UNKNOWN_PORT + GP_ERROR_NOT_SUPPORTED + GP_ERROR_IO + GP_ERROR_TIMEOUT + GP_ERROR_IO_SUPPORTED_SERIAL + GP_ERROR_IO_SUPPORTED_USB + GP_ERROR_IO_INIT + GP_ERROR_IO_READ + GP_ERROR_IO_WRITE + GP_ERROR_IO_UPDATE + GP_ERROR_IO_SERIAL_SPEED + GP_ERROR_IO_USB_CLEAR_HALT + GP_ERROR_IO_USB_FIND + GP_ERROR_IO_USB_CLAIM + GP_ERROR_IO_LOCK + + char *gp_port_result_as_string (int result) + +#------------------------------------------------------------------------------ + +cdef extern from "gphoto2-port-result.h": + ctypedef enum gphoto2_result: + GP_ERROR_CORRUPTED_DATA + GP_ERROR_FILE_EXISTS + GP_ERROR_MODEL_NOT_FOUND + GP_ERROR_DIRECTORY_NOT_FOUND + GP_ERROR_FILE_NOT_FOUND + GP_ERROR_DIRECTORY_EXISTS + GP_ERROR_CAMERA_BUSY + GP_ERROR_PATH_NOT_ABSOLUTE + GP_ERROR_CANCEL + + char *gp_result_as_string(int result) + +#------------------------------------------------------------------------------ + +cdef extern from "gphoto2-widget.h": + ctypedef struct CameraWidget + + ctypedef enum CameraWidgetType: + GP_WIDGET_WINDOW + GP_WIDGET_SECTION + GP_WIDGET_TEXT + GP_WIDGET_RANGE + GP_WIDGET_TOGGLE + GP_WIDGET_RADIO + GP_WIDGET_MENU + GP_WIDGET_BUTTON + GP_WIDGET_DATE + + ctypedef int (* CameraWidgetCallback) (Camera, CameraWidget, GPContext) + + int gp_widget_new (CameraWidgetType _type, char *label, CameraWidget **widget) + int gp_widget_free (CameraWidget *widget) + int gp_widget_ref (CameraWidget *widget) + int gp_widget_unref (CameraWidget *widget) + + int gp_widget_append (CameraWidget *widget, CameraWidget *child) + int gp_widget_prepend (CameraWidget *widget, CameraWidget *child) + + int gp_widget_count_children (CameraWidget *widget) + int gp_widget_get_child (CameraWidget *widget, int child_number, + CameraWidget **child) + + int gp_widget_get_child_by_label (CameraWidget *widget, char *label, + CameraWidget **child) + int gp_widget_get_child_by_id (CameraWidget *widget, int id, CameraWidget **child) + int gp_widget_get_child_by_name (CameraWidget *widget, char *name, CameraWidget **child) + int gp_widget_get_root (CameraWidget *widget, CameraWidget **root) + int gp_widget_get_parent (CameraWidget *widget, CameraWidget **parent) + + int gp_widget_set_value (CameraWidget *widget, void *value) + int gp_widget_get_value (CameraWidget *widget, void *value) + + int gp_widget_set_name (CameraWidget *widget, char *name) + int gp_widget_get_name (CameraWidget *widget, char **name) + + int gp_widget_set_info (CameraWidget *widget, char *info) + int gp_widget_get_info (CameraWidget *widget, char **info) + + int gp_widget_get_id (CameraWidget *widget, int *id) + int gp_widget_get_type (CameraWidget *widget, CameraWidgetType *type) + int gp_widget_get_label (CameraWidget *widget, char **label) + + int gp_widget_set_range (CameraWidget *range, float low, float high, float increment) + int gp_widget_get_range (CameraWidget *range, float *min, float *max, float *increment) + + int gp_widget_add_choice (CameraWidget *widget, char *choice) + int gp_widget_count_choices (CameraWidget *widget) + int gp_widget_get_choice (CameraWidget *widget, int choice_number, char **choice) + + int gp_widget_changed (CameraWidget *widget) + int gp_widget_set_changed (CameraWidget *widget, int changed) + +#------------------------------------------------------------------------------ + +cdef extern from "gphoto2-file.h": + ctypedef enum defines_file: + GP_MIME_WAV + GP_MIME_RAW + GP_MIME_PNG + GP_MIME_PGM + GP_MIME_PPM + GP_MIME_PNM + GP_MIME_JPEG + GP_MIME_TIFF + GP_MIME_BMP + GP_MIME_QUICKTIME + GP_MIME_AVI + GP_MIME_CRW + GP_MIME_UNKNOWN + GP_MIME_EXIF + + ctypedef enum CameraFileType: + GP_FILE_TYPE_PREVIEW + GP_FILE_TYPE_NORMAL + GP_FILE_TYPE_RAW + GP_FILE_TYPE_AUDIO + GP_FILE_TYPE_EXIF + + ctypedef struct CameraFile + + int gp_file_new (CameraFile **file) + int gp_file_ref (CameraFile *file) + int gp_file_unref (CameraFile *file) + int gp_file_free (CameraFile *file) + + int gp_file_open (CameraFile *file, char *filename) + int gp_file_save (CameraFile *file, char *filename) + int gp_file_clean (CameraFile *file) + int gp_file_copy (CameraFile *destination, CameraFile *source) + + int gp_file_set_name (CameraFile *file, char *name) + int gp_file_get_name (CameraFile *file, char **name) + + int gp_file_set_mime_type (CameraFile *file, char *mime_type) + int gp_file_get_mime_type (CameraFile *file, char **mime_type) + + int gp_file_set_type (CameraFile *file, CameraFileType type) + int gp_file_get_type (CameraFile *file, CameraFileType *type) + + int gp_file_set_mtime (CameraFile *file, mtime) + int gp_file_get_mtime (CameraFile *file, mtime) + + int gp_file_detect_mime_type (CameraFile *file) + int gp_file_adjust_name_for_mime_type (CameraFile *file) + + int gp_file_append (CameraFile*, char *data, unsigned long int size) + int gp_file_set_data_and_size (CameraFile*, char *data, unsigned long int size) + int gp_file_get_data_and_size (CameraFile*, char **data, unsigned long int *size) + +#------------------------------------------------------------------------------ + +cdef extern from "gphoto2-list.h": + ctypedef enum defines_list: + MAX_ENTRIES + + cdef struct s_entry: + char name[128] + char value[128] + + ctypedef struct CameraList: + int count + s_entry entry[MAX_ENTRIES] + int ref_count + + int gp_list_new (CameraList **list) + int gp_list_ref (CameraList *list) + int gp_list_unref (CameraList *list) + int gp_list_free (CameraList *list) + + int gp_list_count (CameraList *list) + int gp_list_append (CameraList *list, char *name, char *value) + int gp_list_reset (CameraList *list) + int gp_list_sort (CameraList *list) + + int gp_list_get_name (CameraList *list, int index, char **name) + int gp_list_get_value (CameraList *list, int index, char **value) + + int gp_list_set_name (CameraList *list, int index, char *name) + int gp_list_set_value (CameraList *list, int index, char *value) + + int gp_list_populate (CameraList *list, char *format, int count) + +#------------------------------------------------------------------------------ + +cdef extern from "gphoto2-filesys.h": + + ctypedef enum CameraFileInfoFields: + GP_FILE_INFO_NONE + GP_FILE_INFO_TYPE + GP_FILE_INFO_NAME + GP_FILE_INFO_SIZE + GP_FILE_INFO_WIDTH + GP_FILE_INFO_HEIGHT + GP_FILE_INFO_PERMISSIONS + GP_FILE_INFO_STATUS + GP_FILE_INFO_MTIME + GP_FILE_INFO_ALL + + ctypedef enum CameraFilePermissions: + GP_FILE_PERM_NONE + GP_FILE_PERM_READ + GP_FILE_PERM_DELETE + GP_FILE_PERM_ALL + + ctypedef enum CameraFileStatus: + GP_FILE_STATUS_NOT_DOWNLOADED + GP_FILE_STATUS_DOWNLOADED + + ctypedef struct CameraFileInfoFile: + CameraFileInfoFields fields + CameraFileStatus status + unsigned long size + char type[64] + + unsigned int width, height + char name[64] + CameraFilePermissions permissions + time_t mtime + + ctypedef struct CameraFileInfoPreview: + CameraFileInfoFields fields + CameraFileStatus status + unsigned long size + char type[64] + unsigned int width, height + + ctypedef struct CameraFileInfoAudio: + CameraFileInfoFields fields + CameraFileStatus status + unsigned long size + char type[64] + + ctypedef struct CameraFileInfo: + CameraFileInfoPreview preview + CameraFileInfoFile file + CameraFileInfoAudio audio + + ctypedef struct CameraFilesystem + + int gp_filesystem_new (CameraFilesystem **fs) + int gp_filesystem_free (CameraFilesystem *fs) + + int gp_filesystem_append (CameraFilesystem *fs, char *folder, char *filename, GPContext *context) + int gp_filesystem_set_info_noop (CameraFilesystem *fs, char *folder, CameraFileInfo info, GPContext *context) + int gp_filesystem_set_file_noop (CameraFilesystem *fs, char *folder, CameraFile *file, GPContext *context) + int gp_filesystem_delete_file_noop (CameraFilesystem *fs, char *folder, char *filename, GPContext *context) + int gp_filesystem_reset (CameraFilesystem *fs) + + int gp_filesystem_count (CameraFilesystem *fs, char *folder, GPContext *context) + int gp_filesystem_name (CameraFilesystem *fs, char *folder, int filenumber, char **filename, GPContext *context) + int gp_filesystem_get_folder (CameraFilesystem *fs, char *filename, char **folder, GPContext *context) + int gp_filesystem_number (CameraFilesystem *fs, char *folder, char *filename, GPContext *context) + + ctypedef int (*CameraFilesystemListFunc) (CameraFilesystem *fs, char *folder, CameraList *list, void *data, GPContext *context) + int gp_filesystem_set_list_funcs (CameraFilesystem *fs, CameraFilesystemListFunc file_list_func, CameraFilesystemListFunc folder_list_func, void *data) + int gp_filesystem_list_files (CameraFilesystem *fs, char *folder, CameraList *list, GPContext *context) + int gp_filesystem_list_folders (CameraFilesystem *fs, char *folder, CameraList *list, GPContext *context) + + ctypedef int (*CameraFilesystemSetInfoFunc) (CameraFilesystem *fs, char *folder, char *filename, CameraFileInfo info, void *data, GPContext *context) + ctypedef int (*CameraFilesystemGetInfoFunc) (CameraFilesystem *fs, char *folder, char *filename, CameraFileInfo *info, void *data, GPContext *context) + int gp_filesystem_set_info_funcs (CameraFilesystem *fs, CameraFilesystemGetInfoFunc get_info_func, + CameraFilesystemSetInfoFunc set_info_func, + void *data) + int gp_filesystem_get_info (CameraFilesystem *fs, char *folder, + char *filename, CameraFileInfo *info, + GPContext *context) + int gp_filesystem_set_info (CameraFilesystem *fs, char *folder, + char *filename, CameraFileInfo info, + GPContext *context) + + ctypedef int (*CameraFilesystemGetFileFunc) (CameraFilesystem *fs, + char *folder, + char *filename, + CameraFileType type, + CameraFile *file, void *data, + GPContext *context) + ctypedef int (*CameraFilesystemDeleteFileFunc) (CameraFilesystem *fs, + char *folder, + char *filename, + void *data, GPContext *context) + int gp_filesystem_set_file_funcs (CameraFilesystem *fs, + CameraFilesystemGetFileFunc get_file_func, + CameraFilesystemDeleteFileFunc del_file_func, + void *data) + int gp_filesystem_get_file (CameraFilesystem *fs, char *folder, + char *filename, CameraFileType type, + CameraFile *file, GPContext *context) + int gp_filesystem_delete_file (CameraFilesystem *fs, char *folder, + char *filename, GPContext *context) + + ctypedef int (*CameraFilesystemPutFileFunc) (CameraFilesystem *fs, + char *folder, + CameraFile *file, void *data, + GPContext *context) + ctypedef int (*CameraFilesystemDeleteAllFunc) (CameraFilesystem *fs, + char *folder, void *data, + GPContext *context) + ctypedef int (*CameraFilesystemDirFunc) (CameraFilesystem *fs, + char *folder, + char *name, void *data, + GPContext *context) + int gp_filesystem_set_folder_funcs (CameraFilesystem *fs, + CameraFilesystemPutFileFunc put_file_func, + CameraFilesystemDeleteAllFunc delete_all_func, + CameraFilesystemDirFunc make_dir_func, + CameraFilesystemDirFunc remove_dir_func, + void *data) + int gp_filesystem_put_file (CameraFilesystem *fs, char *folder, + CameraFile *file, GPContext *context) + int gp_filesystem_delete_all (CameraFilesystem *fs, char *folder, + GPContext *context) + int gp_filesystem_make_dir (CameraFilesystem *fs, char *folder, + char *name, GPContext *context) + int gp_filesystem_remove_dir (CameraFilesystem *fs, char *folder, + char *name, GPContext *context) + + int gp_filesystem_dump (CameraFilesystem *fs) + +#------------------------------------------------------------------------------ + +cdef extern from "gphoto2-abilities-list.h": + ctypedef enum CameraDriverStatus: + GP_DRIVER_STATUS_PRODUCTION + GP_DRIVER_STATUS_TESTING + GP_DRIVER_STATUS_EXPERIMENTAL + GP_DRIVER_STATUS_DEPRECATED + + ctypedef enum CameraOperation: + GP_OPERATION_NONE + GP_OPERATION_CAPTURE_IMAGE + GP_OPERATION_CAPTURE_VIDEO + GP_OPERATION_CAPTURE_AUDIO + GP_OPERATION_CAPTURE_PREVIEW + GP_OPERATION_CONFIG + + ctypedef enum CameraFileOperation: + GP_FILE_OPERATION_NONE + GP_FILE_OPERATION_DELETE + GP_FILE_OPERATION_PREVIEW + GP_FILE_OPERATION_RAW + GP_FILE_OPERATION_AUDIO + GP_FILE_OPERATION_EXIF + + ctypedef enum CameraFolderOperation: + GP_FOLDER_OPERATION_NONE + GP_FOLDER_OPERATION_DELETE_ALL + GP_FOLDER_OPERATION_PUT_FILE + GP_FOLDER_OPERATION_MAKE_DIR + GP_FOLDER_OPERATION_REMOVE_DIR + + ctypedef struct CameraAbilities: + char model [128] + CameraDriverStatus status + GPPortType port + int speed [64] + CameraOperation operations + CameraFileOperation file_operations + CameraFolderOperation folder_operations + int usb_vendor, usb_product + int usb_class, usb_subclass, usb_protocol + char library [1024] + char id [1024] + int reserved1 + int reserved2 + int reserved3 + int reserved4 + int reserved5 + int reserved6 + int reserved7 + int reserved8 + + ctypedef struct CameraAbilitiesList + + int gp_abilities_list_new (CameraAbilitiesList **list) + int gp_abilities_list_free (CameraAbilitiesList *list) + int gp_abilities_list_load (CameraAbilitiesList *list, GPContext *context) + int gp_abilities_list_reset (CameraAbilitiesList *list) + int gp_abilities_list_detect (CameraAbilitiesList *list, GPPortInfoList *info_list, CameraList *l, GPContext *context) + int gp_abilities_list_append (CameraAbilitiesList *list, CameraAbilities abilities) + int gp_abilities_list_count (CameraAbilitiesList *list) + int gp_abilities_list_lookup_model (CameraAbilitiesList *list, char *model) + int gp_abilities_list_get_abilities (CameraAbilitiesList *list, int index, CameraAbilities *abilities) + +#------------------------------------------------------------------------------ + +cdef extern from "gphoto2-camera.h": + # include + + ctypedef struct Camera + + #include + #include + + #include + #include + #include + #include + #include + #include + #include + + ctypedef struct CameraText: + char text [32 * 1024] + + ctypedef struct CameraFilePath: + char name [128] + char folder [1024] + + ctypedef enum CameraCaptureType: + GP_CAPTURE_IMAGE + GP_CAPTURE_MOVIE + GP_CAPTURE_SOUND + + ctypedef int (*CameraExitFunc) (Camera *camera, GPContext *context) + ctypedef int (*CameraGetConfigFunc) (Camera *camera, CameraWidget **widget, GPContext *context) + ctypedef int (*CameraSetConfigFunc) (Camera *camera, CameraWidget *widget, GPContext *context) + ctypedef int (*CameraCaptureFunc) (Camera *camera, CameraCaptureType type, CameraFilePath *path, GPContext *context) + ctypedef int (*CameraCapturePreviewFunc) (Camera *camera, CameraFile *file, GPContext *context) + ctypedef int (*CameraSummaryFunc) (Camera *camera, CameraText *text, + GPContext *context) + ctypedef int (*CameraManualFunc) (Camera *camera, CameraText *text, + GPContext *context) + ctypedef int (*CameraAboutFunc) (Camera *camera, CameraText *text, + GPContext *context) + + ctypedef int (*CameraPrePostFunc) (Camera *camera, GPContext *context) + + ctypedef struct CameraFunctions: + CameraPrePostFunc pre_func + CameraPrePostFunc post_func + CameraExitFunc exit + CameraGetConfigFunc get_config + CameraSetConfigFunc set_config + CameraCaptureFunc capture + CameraCapturePreviewFunc capture_preview + CameraSummaryFunc summary + CameraManualFunc manual + CameraAboutFunc about + void *reserved1 + void *reserved2 + void *reserved3 + void *reserved4 + void *reserved5 + void *reserved6 + void *reserved7 + void *reserved8 + + ctypedef GPPort CameraPort + ctypedef GPPortInfo CameraPortInfo + + ctypedef struct CameraPrivateLibrary + ctypedef struct CameraPrivateCore + + cdef struct _Camera: + GPPort *port + CameraFilesystem *fs + CameraFunctions *functions + CameraPrivateLibrary *pl + CameraPrivateCore *pc + + int gp_camera_new (Camera **camera) + + int gp_camera_set_abilities (Camera *camera, CameraAbilities abilities) + int gp_camera_get_abilities (Camera *camera, CameraAbilities *abilities) + int gp_camera_set_port_info (Camera *camera, GPPortInfo info) + int gp_camera_get_port_info (Camera *camera, GPPortInfo *info) + + int gp_camera_set_port_speed (Camera *camera, int speed) + int gp_camera_get_port_speed (Camera *camera) + + int gp_camera_init (Camera *camera, GPContext *context) + int gp_camera_exit (Camera *camera, GPContext *context) + + int gp_camera_ref (Camera *camera) + int gp_camera_unref (Camera *camera) + int gp_camera_free (Camera *camera) + + int gp_camera_get_config (Camera *camera, CameraWidget **window, GPContext *context) + int gp_camera_set_config (Camera *camera, CameraWidget *window, GPContext *context) + int gp_camera_get_summary (Camera *camera, CameraText *summary, GPContext *context) + int gp_camera_get_manual (Camera *camera, CameraText *manual, GPContext *context) + int gp_camera_get_about (Camera *camera, CameraText *about, GPContext *context) + int gp_camera_capture (Camera *camera, CameraCaptureType type, CameraFilePath *path, GPContext *context) + int gp_camera_capture_preview (Camera *camera, CameraFile *file, GPContext *context) + + int gp_camera_folder_list_files (Camera *camera, char *folder, CameraList *list, GPContext *context) + int gp_camera_folder_list_folders (Camera *camera, char *folder, CameraList *list, GPContext *context) + int gp_camera_folder_delete_all (Camera *camera, char *folder, GPContext *context) + int gp_camera_folder_put_file (Camera *camera, char *folder, CameraFile *file, GPContext *context) + int gp_camera_folder_make_dir (Camera *camera, char *folder, char *name, GPContext *context) + int gp_camera_folder_remove_dir (Camera *camera, char *folder, char *name, GPContext *context) + + int gp_camera_file_get_info (Camera *camera, char *folder, char *file, CameraFileInfo *info, GPContext *context) + int gp_camera_file_set_info (Camera *camera, char *folder, char *file, CameraFileInfo info, GPContext *context) + int gp_camera_file_get (Camera *camera, char *folder, char *file, CameraFileType type, CameraFile *camera_file, GPContext *context) + int gp_camera_file_delete (Camera *camera, char *folder, char *file, GPContext *context) + + ctypedef int (* CameraTimeoutFunc) (Camera *camera, GPContext *context) + ctypedef unsigned int (* CameraTimeoutStartFunc) (Camera *camera, unsigned int timeout, CameraTimeoutFunc func, void *data) + ctypedef void (* CameraTimeoutStopFunc) (Camera *camera, unsigned int id, void *data) + void gp_camera_set_timeout_funcs (Camera *camera, CameraTimeoutStartFunc start_func, CameraTimeoutStopFunc stop_func, void *data) + int gp_camera_start_timeout (Camera *camera, unsigned int timeout, CameraTimeoutFunc func) + void gp_camera_stop_timeout (Camera *camera, unsigned int id) + +#------------------------------------------------------------------------------ + +cdef extern from "gphoto2-library.h": + ctypedef int (* CameraLibraryIdFunc) (CameraText *id) + ctypedef int (* CameraLibraryAbilitiesFunc) (CameraAbilitiesList *list) + ctypedef int (* CameraLibraryInitFunc) (Camera *camera, GPContext *context) + int camera_id (CameraText *id) + int camera_abilities (CameraAbilitiesList *list) + int camera_init (Camera *camera, GPContext *context) + +#------------------------------------------------------------------------------ + +cdef extern from "gphoto2-setting.h": + int gp_setting_set (char *id, char *key, char *value) + int gp_setting_get (char *id, char *key, char *value) + +#------------------------------------------------------------------------------ + +def version(verbose=False): + cdef char **cText + if verbose==False: + cText=gp_library_version(GP_VERSION_SHORT) + else: + cText=gp_library_version(GP_VERSION_VERBOSE) + return cText[0] + +cdef check(result): + if result!=0: + txt=gp_result_as_string(result) + raise Exception('Erreur ('+str(result)+') : '+txt) + +cdef class portInfo: + cdef GPPortInfo info + + def __repr__(self): + return self.info.name + +cdef class ports: + cdef GPPortInfoList *portInfoList + + def __new__(self): + check(gp_port_info_list_new(&self.portInfoList)) + + def __dealloc__(self): + check(gp_port_info_list_free(self.portInfoList)) + + def load(self): + check(gp_port_info_list_load(self.portInfoList)) + + def count(self): + return gp_port_info_list_count(self.portInfoList) + + def __getitem__(self, num): + cdef portInfo info + info=portInfo() + check(gp_port_info_list_get_info(self.portInfoList, num, &info.info)) + return info + +cdef class cameraList: + cdef CameraList *liste + + def __new__(self): + check(gp_list_new(&self.liste)) + + def __dealloc__(self): + check(gp_list_free(self.liste)) + + def count(self): + return gp_list_count(self.liste) + + def __getitem__(self, index): + cdef char *name + cdef char *value + check(gp_list_get_name(self.liste, index, &name)) + check(gp_list_get_value(self.liste, index, &value)) + return (name, value) + +cdef class cameraAbilities: + cdef CameraAbilities abilitie + + def __new__(self): + pass + + def __repr__(self): + return "Model : %s\nStatus : %d\nPort : %d\nOperations : %d\nFile Operations : %d\nFolder Operations : %d\nUSB (vendor/product) : %d/%d\nUSB class : %d/%d/%d\nLibrary : %s\nId : %s\n" % (self.abilitie.model, self.abilitie.status, self.abilitie.port, self.abilitie.operations, self.abilitie.file_operations, self.abilitie.folder_operations, self.abilitie.usb_vendor, self.abilitie.usb_product, self.abilitie.usb_class, self.abilitie.usb_subclass, self.abilitie.usb_protocol, self.abilitie.library, self.abilitie.id) + + property model: + def __get__(self): + return self.abilitie.model + + property status: + def __get__(self): + return self.abilitie.status + + property port: + def __get__(self): + return self.abilitie.port + + property operations: + def __get__(self): + return self.abilitie.operations + + property file_operations: + def __get__(self): + return self.abilitie.file_operations + + property folder_operations: + def __get__(self): + return self.abilitie.folder_operations + + property usb_vendor: + def __get__(self): + return self.abilitie.usb_vendor + + property usb_product: + def __get__(self): + return self.abilitie.usb_product + + property usb_class: + def __get__(self): + return self.abilitie.usb_class + + property usb_subclass: + def __get__(self): + return self.abilitie.usb_subclass + + property usb_protocol: + def __get__(self): + return self.abilitie.usb_protocol + + property library: + def __get__(self): + return self.abilitie.library + + property id: + def __get__(self): + return self.abilitie.id + +cdef class abilities_list: + cdef CameraAbilitiesList *abilitiesList + + def __new__(self): + check(gp_abilities_list_new(&self.abilitiesList)) + + def __dealloc__(self): + check(gp_abilities_list_free(self.abilitiesList)) + + def count(self): + return gp_abilities_list_count(self.abilitiesList) + + def load(self): + check(gp_abilities_list_load(self.abilitiesList, NULL)) + + def __getitem__(self, index): + cdef cameraAbilities ab + ab=cameraAbilities() + check(gp_abilities_list_get_abilities(self.abilitiesList, index, &ab.abilitie)) + return ab + + def lookup_model(self, model): + ret=gp_abilities_list_lookup_model(self.abilitiesList, model) + return ret + + def detect(self, ports p): + cdef cameraList l + l=cameraList() + check(gp_abilities_list_detect(self.abilitiesList, p.portInfoList, l.liste, NULL)) + return l + +cdef class camera: + cdef Camera *camera + + def __new__(self): + check(gp_camera_new(&self.camera)) + + def init(self): + check(gp_camera_init(self.camera, NULL)) + + def __dealloc__(self): + check(gp_camera_free(self.camera)) + + property abilities: + def __set__(self, cameraAbilities ab): + check(gp_camera_set_abilities(self.camera, ab.abilitie)) + def __get__(self): + cdef cameraAbilities ab + ab=cameraAbilities() + check(gp_camera_get_abilities(self.camera, &ab.abilitie)) + return ab + + property summary: + def __get__(self): + cdef CameraText txt + check(gp_camera_get_summary(self.camera, &txt, NULL)) + return txt.text + + def capture_image(self): + cdef CameraFilePath path + check(gp_camera_capture(self.camera, GP_CAPTURE_IMAGE, &path, NULL)) + return (path.folder, path.name) \ No newline at end of file diff --git a/bindings/python/gptest.py b/bindings/python/gptest.py new file mode 100644 index 000000000..cea2e2d99 --- /dev/null +++ b/bindings/python/gptest.py @@ -0,0 +1,54 @@ +# Copyright (C) 2003-2004 David PHAM-VAN -- david@ab2r.com +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +import gphoto2 + +print "GPhoto version "+gphoto2.version() + +#print dir(gphoto2) + +print("Creating camera...") +cam=gphoto2.camera() + +# ports=gphoto2.ports() +# ports.load() +# print ports.count(), " ports trouves" +# for port in range(0,ports.count()): +# print ports[port] +# +# +# print("Setting model...") +# abl=gphoto2.abilities_list() +# abl.load() +# +# print("Detection des cameras...") +# dt=abl.detect(ports) +# print dt.count() +# for i in range(0,dt.count()): +# print dt[i] +# +# mdl=abl.lookup_model(dt[0][0]) +# ab=abl[mdl] +# +# print ab +# +# cam.set_abilities(ab) + +print("Initializing camera...") +cam.init() +print cam.summary +print cam.abilities +print cam.capture_image() \ No newline at end of file diff --git a/bindings/python/setup.py b/bindings/python/setup.py new file mode 100644 index 000000000..d8e2d7e11 --- /dev/null +++ b/bindings/python/setup.py @@ -0,0 +1,31 @@ +# Copyright (C) 2003-2004 David PHAM-VAN -- david@ab2r.com +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +from distutils.core import setup +from distutils.extension import Extension +from Pyrex.Distutils import build_ext + +setup( + name = "python-gphoto2", + ext_modules=[ + Extension( + "gphoto2", ["gphoto2.pyx"], + libraries = ["gphoto2"], + include_dirs = ["/usr/include/gphoto2"] + ) + ], + cmdclass = {'build_ext': build_ext} +)