Skip to content

Instantly share code, notes, and snippets.

@dheaney
Last active August 29, 2015 14:04
Show Gist options
  • Select an option

  • Save dheaney/6a0976f22e38f602d4a7 to your computer and use it in GitHub Desktop.

Select an option

Save dheaney/6a0976f22e38f602d4a7 to your computer and use it in GitHub Desktop.
Volumes in python
from gi.repository import Gio
vm = Gio.VolumeMonitor.get()
for volume in vm.get_volumes():
mount = volume.get_mount()
if mount is not None:
print mount.get_default_location().get_path()
paths = [ volume.get_mount().get_default_location().get_path()
for volume in vm.get_volumes() if volume.get_mount() is not None ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment