How to use the udiskie.common.decode_ay function in udiskie

To help you get started, we’ve selected a few udiskie examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github coldfix / udiskie / udiskie / udisks2.py View on Github external
def device_id(self):
        """
        Return a unique and persistent identifier for the device.

        This is the basename (last path component) of the symlink in
        `/dev/disk/by-id/`.
        """
        if self.is_block:
            for filename in self._P.Block.Symlinks:
                parts = decode_ay(filename).split('/')
                if parts[-2] == 'by-id':
                    return parts[-1]
        elif self.is_drive:
            return self._assocdrive._P.Drive.Id
        return ''
github coldfix / udiskie / udiskie / udisks2.py View on Github external
def mount_paths(self):
        """Return list of active mount paths."""
        return list(map(decode_ay, self._P.Filesystem.MountPoints or ()))
github coldfix / udiskie / udiskie / udisks2.py View on Github external
def device_presentation(self):
        """The device file path to present to the user."""
        return decode_ay(self._P.Block.PreferredDevice)
github coldfix / udiskie / udiskie / udisks2.py View on Github external
def symlinks(self):
        """Known symlinks of the block device."""
        if not self._P.Block.Symlinks:
            return []
        return [decode_ay(path) for path in self._P.Block.Symlinks]
github coldfix / udiskie / udiskie / udisks2.py View on Github external
def device_file(self):
        """The filesystem path of the device block file."""
        return decode_ay(self._P.Block.Device)
github coldfix / udiskie / udiskie / udisks2.py View on Github external
def loop_file(self):
        """Get the file backing the loop device."""
        return decode_ay(self._P.Loop.BackingFile)