Re: [PATCH] Added the libudev python bindings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > +class Udev(object):
> > +
> > +    def __init__(self):
> > +        self.udev = libudev_udev_new()
> > +
> > +    def create_device(self, sysfs_path):
> > +        return UdevDevice(self.udev, sysfs_path)
> > +
> > +    def scan_devices(self, subsystem=None):
> > +        enumerate = libudev_udev_enumerate_new(self.udev)
> 
> scan_devices could take a while, I suppose.  Is it worth making it
> return an iterator so it doesn't have to grab everything all at once
> and
> can instead grab each individual device as needed?  Or am I just
> making
> things too complicated now?


For now, we are not even using this scan_devices function.
We're using the udev_enumerate_devices from baseudev, and using the bindings
just to get the properties, not to build the whole devices list,
because maybe it returns different devices, than the old function,
so we don't want to break anything that's not broken.

I know you love iterators :) so I can think about it later, for F13 maybe?
When we will want to use it instead of listing the files in /sys.

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux