{"action":"created","issue":{"url":"https://api.github.com/repos/jim-easterbrook/python-gphoto2/issues/50","repository_url":"https://api.github.com/repos/jim-easterbrook/python-gphoto2","labels_url":"https://api.github.com/repos/jim-easterbrook/python-gphoto2/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/jim-easterbrook/python-gphoto2/issues/50/comments","events_url":"https://api.github.com/repos/jim-easterbrook/python-gphoto2/issues/50/events","html_url":"https://github.com/jim-easterbrook/python-gphoto2/issues/50","id":299715531,"number":50,"title":"camera.wait_for_event works?","user":{"login":"dmitryelj","id":18378056,"avatar_url":"https://avatars2.githubusercontent.com/u/18378056?v=4","gravatar_id":"","url":"https://api.github.com/users/dmitryelj","html_url":"https://github.com/dmitryelj","followers_url":"https://api.github.com/users/dmitryelj/followers","following_url":"https://api.github.com/users/dmitryelj/following{/other_user}","gists_url":"https://api.github.com/users/dmitryelj/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitryelj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitryelj/subscriptions","organizations_url":"https://api.github.com/users/dmitryelj/orgs","repos_url":"https://api.github.com/users/dmitryelj/repos","events_url":"https://api.github.com/users/dmitryelj/events{/privacy}","received_events_url":"https://api.github.com/users/dmitryelj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-23T13:43:43Z","updated_at":"2018-02-23T13:59:45Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nI'm testing the wait_for_event method now, the idea is to download the files.\r\n\r\n        context = gp.Context()\r\n        camera = gp.Camera()\r\n        camera.init(context)\r\n\r\n        while True:\r\n                type, data = camera.wait_for_event(1000, context)\r\n                print \"gp_camera_wait_for_event:\", type, data\r\n                if type == gp.GP_EVENT_FILE_ADDED:\r\n                    pass\r\n                if type == gp.GP_EVENT_TIMEOUT:\r\n                    pass\r\n\r\nThe \"type\" is always 0, and the output looks like this:\r\ngp_camera_wait_for_event: 0 PTP Property d105 changed\r\ngp_camera_wait_for_event: 0 PTP Property d108 changed\r\ngp_camera_wait_for_event: 0 PTP Property d106 changed\r\ngp_camera_wait_for_event: 0 PTP Property d107 changed\r\n\r\nShould it be different?\r\n\r\nI'm checking the \"sample-tether.c\" code from a library (it works btw:), there are 2 additional parameters:\r\n\tCameraEventType\tevttype;\r\n\tCameraFilePath\t*path;\r\n\tretval = gp_camera_wait_for_event (camera, 1000, &evttype, &evtdata, context);\r\n\r\nI tried to do the same like this (maybe wrong ctypes usage):\r\n            intc = ctypes.c_int(0)\r\n            char_data = ctypes.c_char_p(0)\r\n            type, data = camera.wait_for_event(1000, ctypes.pointer(intc), ctypes.pointer(char_data), context)\r\n\r\nBut getting the error \"TypeError: Camera_wait_for_event expected at most 2 arguments, got 4\".\r\n\r\nIn the \"camera.i\" I see:\r\nMEMBER_FUNCTION_THREAD(_Camera, Camera,\r\n    wait_for_event,\r\n    (int timeout, CameraEventType *eventtype, void **eventdata, GPContext *context),\r\n    gp_camera_wait_for_event, ($self, timeout, eventtype, eventdata, context))\r\n\r\nSo, it should support 4 arguments? Or something was changed?\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/jim-easterbrook/python-gphoto2/issues/comments/368016254","html_url":"https://github.com/jim-easterbrook/python-gphoto2/issues/50#issuecomment-368016254","issue_url":"https://api.github.com/repos/jim-easterbrook/python-gphoto2/issues/50","id":368016254,"user":{"login":"dmitryelj","id":18378056,"avatar_url":"https://avatars2.githubusercontent.com/u/18378056?v=4","gravatar_id":"","url":"https://api.github.com/users/dmitryelj","html_url":"https://github.com/dmitryelj","followers_url":"https://api.github.com/users/dmitryelj/followers","following_url":"https://api.github.com/users/dmitryelj/following{/other_user}","gists_url":"https://api.github.com/users/dmitryelj/gists{/gist_id}","starred_url":"https://api.github.com/users/dmitryelj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmitryelj/subscriptions","organizations_url":"https://api.github.com/users/dmitryelj/orgs","repos_url":"https://api.github.com/users/dmitryelj/repos","events_url":"https://api.github.com/users/dmitryelj/events{/privacy}","received_events_url":"https://api.github.com/users/dmitryelj/received_events","type":"User","site_admin":false},"created_at":"2018-02-23T13:59:45Z","updated_at":"2018-02-23T13:59:45Z","author_association":"NONE","body":"Thanks for answer. The question is, that \"type\" is always 0."}}
{"actor":{"display_login":"dmitryelj"}}