Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUdev pygobject migration #5

Merged
merged 3 commits into from
Aug 9, 2014

Conversation

javihernandez
Copy link
Collaborator

Hi Felix!

I've been trying to use Udev Discover under openSUSE 12.1 and I turned into an issue.
I know that actually, Udev Discover is partially ported to the new GObject Introspection based bindings, but gudev migration is missing, because it was not possible to get done when the migration happened. Since pygobject doesn't support this situation from the 2.90.3 version, udev-discover needs this patch if we want to keep it working in newest distributions.

So, here's a patch! ;)
I've ported the remaining code, and all seems fine to me, but I have a question.

I removed the 'subsystems' argument while I'm getting some 'GUdev.Client' objects (see lines below)

  • self.client = gudev.Client(subsystems)
  • self.client = GUdev.Client()

Don't know the real impact of this, so it will be great if you make a review.

JFYI, I'm using GUdev from git (version 182) because there were some missing annotations, like the 'Device.get_parent' one.

Best regards!

@fontanon
Copy link
Owner

fontanon commented Apr 7, 2012

Awsome!
The point is that I figure some of this changes will break an udev-discover's key feature: user's ability to choose a slice of kernel subsystems to deal with. I've done some comments on the patch, please check it.

So. which is the best environment to try myself the patch working? Any OS with GUdev r182?

Thanks!

@javihernandez
Copy link
Collaborator Author

Hey, thanks for your quick reply! ;)

Since my two boxes are running Gnome 3.2 environments, I have no way of trying the latest udev-discover stable release.

About my environment, I'm under openSUSE 12.1, with udev 1 from git, and kmod 2 from git too (as a required dependency for udev). You can also try with Fedora 16 or with the upcoming Ubuntu 12.04. Don't know about the minimum required udev version in each distribution, but you'll have to ensure that the udev version you're using includes this pretty commit 3

About the behaviour in GUdev.Client method, Sorry, I overlooked the "new" method, so I've switched (and pushed to this pull request related branch) all the GUdev.Client calls into GUdev.Client.new ones. In this way, we can pass the "subsystems" parameter and all seems to work as expected.

Anyway, I think that pinging udev developers about the use of the gudev bindings will be very useful here, AFAIK we should be able to use the GUdev.Client method directly.

Regards!

@fontanon
Copy link
Owner

I've added you as collaborator. Please feel free to merge.
What would be more convenient for merge the pull request?:
1.- Into master
2.- Into a new branch for git version of udev

Best regards!

@javihernandez
Copy link
Collaborator Author

Hi!

Thanks for giving me such privileges!

About where to push ...

Since we need a very recent version of udev, we should wait until we know when distributions are planning to include such udev version, so we just can create a new branch as you've suggested and including an up-to-date README file with the specific branch information. I think 'udev-178' could be the branch name. Ideas?

About the use of GUdev.Client, I talked with pygobject developers and told me to file a bug in gudev. I did it, and got a response 1 from David Zeuthen, so "the best practice" in passing the arguments still needs to be discussed a little bit. Anyway, we're ok to go with the "GUdev.Client.new" method. ;)

Regards!

@fontanon
Copy link
Owner

Will you create this new branch? What's the next step?

fontanon added a commit that referenced this pull request Aug 9, 2014
@fontanon fontanon merged commit be77bf0 into fontanon:master Aug 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants