Exemple #1
0
    def _get_format_data(self, fmt):
        """Get the format data.

        :param fmt: an instance of DeviceFormat
        :return: an instance of DeviceFormatData
        """
        # Collect the format data.
        data = DeviceFormatData()
        data.type = fmt.type or ""
        data.mountable = fmt.mountable
        data.description = fmt.name or ""

        # Collect the additional attributes.
        attrs = self._get_attributes(fmt, DeviceFormatData.SUPPORTED_ATTRIBUTES)
        data.attrs = attrs

        return data