From 70747d380ca9bb9daad3f69bad9239babf4daa6b Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Wed, 15 Aug 2012 15:55:33 -0400 Subject: [PATCH] cc-4230: fixed bug in no_extension_basename function --- python_apps/media-monitor2/media/monitor/pure.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/python_apps/media-monitor2/media/monitor/pure.py b/python_apps/media-monitor2/media/monitor/pure.py index 7160f18c0..81843e8bd 100644 --- a/python_apps/media-monitor2/media/monitor/pure.py +++ b/python_apps/media-monitor2/media/monitor/pure.py @@ -117,15 +117,17 @@ def no_extension_basename(path): """ returns the extensionsless basename of a filepath >>> no_extension_basename("/home/test.mp3") - 'test' + u'test' >>> no_extension_basename("/home/test") - 'test' + u'test' >>> no_extension_basename('blah.ml') - 'blah' + u'blah' + >>> no_extension_basename('a.b.c.d.mp3') + u'a.b.c.d' """ base = unicode(os.path.basename(path)) if extension(base) == "": return base - else: return base.split(".")[-2] + else: return '.'.join(base.split(".")[0:-1]) def walk_supported(directory, clean_empties=False): """