Cleanup how `set_combo_value` is used
For example if you PITIVI_DEBUG=6 pitivi
, new project, create title clip, render, choose preset "youtube", notice in the console:
INFO 21:33:40 utils None set_combo_value: Could not set value <Gst.ElementFactory object at 0x7f3d8b649140 (GstElementFactory at 0x55b19be91490)>, possible values: ['JPEG image', 'On2 VP8', 'x264enc', 'Unsupported'] (pitivi/utils/ui.py:757)
This message is confusing, giving the impression that the value
parameter passed to the function is of the wrong type. The v[0]
should be v[1]
to fix this.
The set_combo_value
method returns False
when it fails, but the value is often ignored and sometimes errors can remain undetected. In at least a few cases it's appropriate to check the returned value, for example:
res = set_combo_value(combo, value)
assert res, value
Edited by Alexandru Băluț