* morituri/common/checksum.py:

Style fixes.
	* morituri/common/common.py:
	  Add functions to convert a gst.TagList to a dict and compare them.
	* morituri/common/task.py:
	  Add setAndRaiseException which gives us an appropriate
	  exceptionMessage as if we raised where we called this new function.
This commit is contained in:
Thomas Vander Stichele
2010-04-13 21:53:43 +00:00
parent 310a3789c0
commit 7515cf9e73
4 changed files with 54 additions and 1 deletions

View File

@@ -182,3 +182,26 @@ class PersistedCache(object):
persister.delete()
return persister
def tagListToDict(tl):
"""
Removes audio-codec and video-codec since we never set them ourselves.
"""
import gst
d = {}
for key in tl.keys():
if key == gst.TAG_DATE:
date = tl[key]
d[key] = "%4d-%2d-%2d" % (date.year, date.month, date.day)
elif key in [gst.TAG_AUDIO_CODEC, gst.TAG_VIDEO_CODEC]:
pass
else:
d[key] = tl[key]
return d
def tagListEquals(tl1, tl2):
d1 = tagListToDict(tl1)
d2 = tagListToDict(tl2)
return d1 == d2