GNOME Bugzilla – Bug 731008
gst-python: Implement TIME_ARGS helper
Last modified: 2014-09-24 08:28:32 UTC
This helper cannot be translated as it's an expanding C macro. But we could implement it, it should look like def TIME_ARGS(time): if (time == Gst.CLOCK_TIME_NONE): return (99, 99, 99, 999999999) else: return (time / (Gst.SECOND * 60 * 60), time / (Gst.SECOND * 60) % 60, time / Gst.SECOND % 60, time % Gst.SECOND) And could be used like this: print ("Allo %s %" + Gst.TIME_FORMAT + "\n") % (("toto",) + Gst.TIME_ARGS(time)) Would that make sense for Python or is there something better ?
commit 8542c4b21929b2ed84272deb3ae49a2766c82035 Author: Olivier Crête <olivier.crete@collabora.com> Date: Tue Dec 3 17:49:11 2013 -0500 Gst: Add python version of GST_TIME_ARGS Though it's used differentlu: print ("Allo %s" + Gst.TIME_ARGS(time) + "\n") % "toto" or print ("Allo %s %s\n" % ("toto", Gst.TIME_ARGS(time)))