Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/tautils.py
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2010-02-07 13:36:18 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2010-02-07 13:36:18 (GMT)
commit5e60bbc230e7545ab84e2b0d1b840957175d8570 (patch)
tree0b264fcd5425c344139fdbc176f5ae82cd10671b /tautils.py
parentaedefb612c364461f2c40cbcdd005ed8f9366901 (diff)
switched to .endswith
Diffstat (limited to 'tautils.py')
-rw-r--r--tautils.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/tautils.py b/tautils.py
index 77536b0..60c906e 100644
--- a/tautils.py
+++ b/tautils.py
@@ -156,15 +156,14 @@ def get_pixbuf_from_journal(dsobject, w, h):
pixbuf = None
return pixbuf
-def movie_media_type(suffix):
- if suffix.replace('.','') in ['ogv','vob','mp4','wmv','mov', 'mpeg']:
- return True
- return False
-
-def audio_media_type(suffix):
- if suffix.replace('.','') in ['ogg', 'oga', 'm4a']:
- return True
- return False
+def movie_media_type(name):
+ return name.endswith(('.ogv','.vob','.mp4','.wmv','.mov', '.mpeg'))
+
+def audio_media_type(name):
+ return name.endswith(('.ogg', '.oga', '.m4a'))
+
+def image_media_type(name):
+ return name.endswith(('.png', '.jpg', '.jpeg', '.gif', '.tiff', '.tif'))
def round_int(n):
if int(float(n)) == n: