Exemple #1
0
 def __len__(self):
     """
     Return the amount of properties defined for this device as integer.
     """
     properties = libudev.udev_device_get_properties_list_entry(self)
     i = 0
     for i, _ in enumerate(udev_list_iterate(properties), start=1):
         pass
     return i
Exemple #2
0
 def __len__(self):
     """
     Return the amount of properties defined for this device as integer.
     """
     properties = libudev.udev_device_get_properties_list_entry(self)
     i = 0
     for i, _ in enumerate(udev_list_iterate(properties), start=1):
         pass
     return i
Exemple #3
0
    def __iter__(self):
        """
        Iterate over the names of all properties defined for this device.

        Return a generator yielding the names of all properties of this
        device as unicode strings.
        """
        properties = libudev.udev_device_get_properties_list_entry(self)
        for name, _ in udev_list_iterate(properties):
            yield ensure_unicode_string(name)
Exemple #4
0
    def __iter__(self):
        """
        Iterate over the names of all properties defined for this device.

        Return a generator yielding the names of all properties of this
        device as unicode strings.
        """
        properties = libudev.udev_device_get_properties_list_entry(self)
        for name, _ in udev_list_iterate(properties):
            yield ensure_unicode_string(name)