* Inconsistences using GUdev.Client
@ 2012-04-12 12:18 Javier Hernández Antúnez
2012-04-12 12:59 ` Javier Hernández Antúnez
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Javier Hernández Antúnez @ 2012-04-12 12:18 UTC (permalink / raw)
To: linux-hotplug
Hi!
I've been porting a python application which uses gudev to use the new
gobject-introspection based bindings, but I encountered an issue. So,
I pulled udev from master and the issue was still there, so I went to
talk with some pygobject developers, and here's a retail of the
conversation.
16:12 < jhernandez> I'm using GUdev with pygobject
16:12 < jhernandez> and, I have some doubts regarding the way I'm using it
16:13 < jhernandez> with the old python-gudev, I was used to do like
this: client = gudev.Client(subsystems)
16:14 < jhernandez> using the gobject introspected bindings, I'm not
able to get my client object like I was used
16:14 < jhernandez> instead, I need to use the gudev.Client.new method
16:16 < jhernandez> should I report this as a bug? or it is my fault?
16:59 < tomeu> all GObjects should be instantiable with g_object_new
16:59 < tomeu> the problem is people doing things in _new_* that
should be done instead in _init or _construct
16:59 < tomeu> jhernandez: it's a bug that should be reported
17:00 < tomeu> (in GUDev)
17:00 < jhernandez> tomeu: ACK
JFYI, the full conversation log is here [1]
I think the final decision on this is up to udev/gudev developers, and
I'll try (with some help) to provide a patch if it is really needed.
My devel environment consists in:
- openSUSE 12.1 + Official updates
- udev pulled from master (182)
Best regards!
[1]: http://pastebin.com/js7rKh3J
--
Javier Hernández Antúnez
<jhernandez@emergya.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Inconsistences using GUdev.Client
2012-04-12 12:18 Inconsistences using GUdev.Client Javier Hernández Antúnez
@ 2012-04-12 12:59 ` Javier Hernández Antúnez
2012-04-12 15:32 ` David Zeuthen
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Javier Hernández Antúnez @ 2012-04-12 12:59 UTC (permalink / raw)
To: linux-hotplug
Hi!
I've been porting a python application which uses gudev to use the new
gobject-introspection based bindings, but I encountered an issue. So,
I pulled udev from master and the issue was still there, so I went to
talk with some pygobject developers, and here's a retail of the
conversation.
16:12 < jhernandez> I'm using GUdev with pygobject
16:12 < jhernandez> and, I have some doubts regarding the way I'm using it
16:13 < jhernandez> with the old python-gudev, I was used to do like
this: client = gudev.Client(subsystems)
16:14 < jhernandez> using the gobject introspected bindings, I'm not
able to get my client object like I was used
16:14 < jhernandez> instead, I need to use the gudev.Client.new method
16:16 < jhernandez> should I report this as a bug? or it is my fault?
16:59 < tomeu> all GObjects should be instantiable with g_object_new
16:59 < tomeu> the problem is people doing things in _new_* that
should be done instead in _init or _construct
16:59 < tomeu> jhernandez: it's a bug that should be reported
17:00 < tomeu> (in GUDev)
17:00 < jhernandez> tomeu: ACK
JFYI, the full conversation log is here [1]
I think the final decision on this is up to udev/gudev developers, and
I'll try (with some help) to provide a patch if it is really needed.
My devel environment consists in:
- openSUSE 12.1 + Official updates
- udev pulled from master (182)
Best regards!
[1]: http://pastebin.com/js7rKh3J
--
Javier Hernández Antúnez
<jhernandez@emergya.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Inconsistences using GUdev.Client
2012-04-12 12:18 Inconsistences using GUdev.Client Javier Hernández Antúnez
2012-04-12 12:59 ` Javier Hernández Antúnez
@ 2012-04-12 15:32 ` David Zeuthen
2012-05-05 21:42 ` Martin Pitt
2012-05-06 12:55 ` Martin Pitt
3 siblings, 0 replies; 5+ messages in thread
From: David Zeuthen @ 2012-04-12 15:32 UTC (permalink / raw)
To: linux-hotplug
Hi,
On Thu, Apr 12, 2012 at 8:18 AM, Javier Hernández Antúnez
<jhernandez@emergya.com> wrote:
> 16:59 < tomeu> the problem is people doing things in _new_* that
> should be done instead in _init or _construct
> 16:59 < tomeu> jhernandez: it's a bug that should be reported
> 17:00 < tomeu> (in GUDev)
> 17:00 < jhernandez> tomeu: ACK
I think you are confused, see
http://cgit.freedesktop.org/systemd/systemd/tree/src/udev/gudev/gudevclient.c#n318
basically, what we do is this
GUdevClient *
g_udev_client_new (const gchar * const *subsystems)
{
return G_UDEV_CLIENT (g_object_new (G_UDEV_TYPE_CLIENT,
"subsystems", subsystems, NULL));
}
I think the python bindings are just buggy - probably they don't
support GStrv GObject properties very well.
David
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Inconsistences using GUdev.Client
2012-04-12 12:18 Inconsistences using GUdev.Client Javier Hernández Antúnez
2012-04-12 12:59 ` Javier Hernández Antúnez
2012-04-12 15:32 ` David Zeuthen
@ 2012-05-05 21:42 ` Martin Pitt
2012-05-06 12:55 ` Martin Pitt
3 siblings, 0 replies; 5+ messages in thread
From: Martin Pitt @ 2012-05-05 21:42 UTC (permalink / raw)
To: linux-hotplug
David Zeuthen [2012-04-12 11:32 -0400]:
> I think the python bindings are just buggy - probably they don't
> support GStrv GObject properties very well.
Is that still the case? I just tried this with current PyGObject
3.2.0, and it seems to work:
$ python
>>> from gi.repository import GUdev
>>> c = GUdev.Client.new(subsystems=['usb'])
>>> c.props.subsystems
['usb']
>>>
I also tested with "GUdev.Client(subsystems=['usb'])", i. e. using the
GObject constructor instead of gudev_client_new(), and it works just
as well.
I am just committing test cases for handling GStrv properties to g-i
and pygobject, and indeed a few cases don't work yet (such as defining
GStrv properties in Python, and _setting_ GStrv properties). I'm
working my way through fixing those.
Thanks,
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Inconsistences using GUdev.Client
2012-04-12 12:18 Inconsistences using GUdev.Client Javier Hernández Antúnez
` (2 preceding siblings ...)
2012-05-05 21:42 ` Martin Pitt
@ 2012-05-06 12:55 ` Martin Pitt
3 siblings, 0 replies; 5+ messages in thread
From: Martin Pitt @ 2012-05-06 12:55 UTC (permalink / raw)
To: linux-hotplug
Hello again,
Martin Pitt [2012-05-05 14:42 -0700]:
> I am just committing test cases for handling GStrv properties to g-i
> and pygobject, and indeed a few cases don't work yet (such as defining
> GStrv properties in Python, and _setting_ GStrv properties). I'm
> working my way through fixing those.
For the record, all done now:
http://git.gnome.org/browse/pygobject/commit/?idò494526e1c
http://git.gnome.org/browse/pygobject/commit/?idƒ21af2c7df
http://git.gnome.org/browse/pygobject/commit/?idŸ50fd214e4
However, setting GStrv properties in the constructor has already
worked before.
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-05-06 12:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-12 12:18 Inconsistences using GUdev.Client Javier Hernández Antúnez
2012-04-12 12:59 ` Javier Hernández Antúnez
2012-04-12 15:32 ` David Zeuthen
2012-05-05 21:42 ` Martin Pitt
2012-05-06 12:55 ` Martin Pitt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.