[pygtk] getLabel() CD-ROM

Gian Mario Tagliaretti gianmt at gnome.org
Tue Aug 28 22:41:12 WST 2007


2007/8/28, Guillermo Heizenreder <gheize a gmail.com>:

Hi Guillermo,

please alway reply to the list as well, the answers you can getcan be
useful for other people, ....hopefully :)

> When Studying the manual I realized that is has all the necessary
> function or method, but not all that glitters it gold.

[...]

> guille a leinad-desktop:~$ python
> Python 2.5.1 (r251:54863, May  2 2007, 16:27:44)
> [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import gnomevfs
> >>> device = gnomevfs.Drive()
> >>> print device
> <gnomevfs.Drive object (GnomeVFSDrive) at 0x2ae482b8c4b0>
> >>> ¿?
>
> I don't now how to connect my object one_device with my CD-ROM, so i can
> get this information.

I think you can do this instead:

Python 2.5.1 (r251:54863, May  2 2007, 16:56:35)
[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gnomevfs
>>> monitor = gnomevfs.VolumeMonitor()
>>> cdrom = monitor.get_volume_for_path('/media/cdrom')
>>> print cdrom.get_display_name()
Whatever is in your cdrom

cheers
-- 
Gian Mario Tagliaretti


More information about the pygtk mailing list