After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 436620 - get_uri_type methods should return enum objects
get_uri_type methods should return enum objects
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-python
git master
Other All
: Normal minor
: 0.10.8
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-05-07 15:32 UTC by René Stadler
Modified: 2007-07-27 11:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make get_uri_type methods return enum objects (574 bytes, patch)
2007-05-07 15:33 UTC, René Stadler
committed Details | Review

Description René Stadler 2007-05-07 15:32:49 UTC
gst.URIHandler.get_uri_type and gst.ElementFactory.get_uri_type methods return plain integers (like their C counterparts).  I'd rather have them return gst.URIType enum instances proper (so I can grab the value nick easily).

Attaching a trivial patch.

P.S.: Note how the C functions have inconsistent return types (gint vs. guint), where both should be rather GstURIType it seems.
Comment 1 René Stadler 2007-05-07 15:33:53 UTC
Created attachment 87718 [details] [review]
Make get_uri_type methods return enum objects
Comment 2 Edward Hervey 2007-07-27 11:22:16 UTC
This is fine by me. The reason why is because you could already check before whether the return value was equal to gst.URI_*

OLD BEHAVIOUR:

In [2]: e = gst.element_factory_make("gnomevfssrc")

In [4]: e.get_uri_type()
Out[4]: 2L

In [5]: e.get_uri_type() == gst.URI_SRC
Out[5]: True



NEW BEHAVIOUR:

In [3]: e.get_uri_type()
Out[3]: <enum GST_URI_SRC of type GstURIType>

In [4]: e.get_uri_type() == gst.URI_SRC
Out[4]: True



2007-07-27  Rene Stadler <mail@renestadler.de>

	reviewed by: Edward Hervey  <bilboed@bilboed.com>
	* gst/gst.defs:
	Make .get_uri_type() methods return a GstURIType enum instead of an
	integer.
	Fixes #436620