Comments (6)
I doubt it's a bug in the Python interface, especially as other cameras work OK. What does the gphoto2 command line client report? (gphoto2 --storage-info
)
If, as I expect, the CLI client also returns nothing then it's a question for the gphoto2 mailing list.
from python-gphoto2.
I'd wondered the same, but I asked the user to double check and this is what is returned:
$ gphoto2 --storage-info
[Storage 0]
label=NIKON D800 [Slot 1]
basedir=/store_00010001
access=2 Nur Lesen und Bilder löschen
type=4 Entfernbarer RAM
fstype=4 Kamera Struktur (DCIM)
totalcapacity=7878464 KB
free=7393472 KB
freeimages=1604
[Storage 1]
label=NIKON D800 [Slot 2]
basedir=/store_00020001
access=2 Nur Lesen und Bilder löschen
type=4 Entfernbarer RAM
fstype=4 Kamera Struktur (DCIM)
totalcapacity=31248384 KB
free=13976416 KB
freeimages=179
from python-gphoto2.
No description in that result. (-:
PS You can iterate over a list directly, rather than using an index. Instead of
for media_index in range(len(self.storage_info)):
info = self.storage_info[media_index]
...
just do
for info in self.storage_info:
...
from python-gphoto2.
Oh yes, you're right. gPhoto2 leaves the entire field out altogether instead of reporting a blank value.
Being able to treat the libgphoto2 result as a proper Python iterable is very useful - was that something you changed at some point? Or perhaps I was too cautious with my code all along. I do have a dim memory of running into the problem of not being able to iterate with some returned result at some point.
from python-gphoto2.
In this particular case the result is a pure Python list. Other libgphoto2 types that have 'count' and 'index' methods (e.g. gp_abilities_list_count and gp_abilities_list_get_abilities) can behave like lists if I add __len__
and __getitem__
methods in the interface. (See https://docs.python.org/2.7/reference/datamodel.html?highlight=__len__#emulating-container-types) I need to check if I've done this everywhere.
from python-gphoto2.
If you run into any problems with iteration in future do let me know. With Python 2 & 3, and "builtin" vs non "builtin" versions of SWIG output I don't always find problems in my limited testing.
from python-gphoto2.
Related Issues (20)
- Missing pre-req's(?) after building libgphoto2 from source on Raspberry Pi HOT 3
- Can not set datetime on Canon EOS 1200D HOT 4
- equivalent of gphoto2 --reset HOT 1
- delete a file HOT 2
- gp_camera_get_single_config HOT 2
- Socket error after gp_camera_exit in windows/msys2 HOT 15
- Faster way to copy files from camera HOT 7
- Sony FX3 overshoot HOT 1
- `delete_file()` does not delete file HOT 9
- Segmentation Fault segfault on gp.Camera.autodetect() on Github Actions Runner HOT 21
- LGPL vs. GPL license? HOT 8
- Test Virtual Camera HOT 4
- Missing bindings for gp_port_new, gp_port_open, and gp_port_reset? HOT 2
- capture_preview() broken in v2.5.0 HOT 4
- having trouble getting gphoto2 on rpi HOT 3
- use python-gphoto2 in Windows system HOT 1
- Always connected capture anytime HOT 1
- Github Actions Python 3.12 environment. HOT 1
- Is live data acquisition available in the library? HOT 1
- Error When Installing with "Local" libgphoto2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-gphoto2.