Removing _jointhat()... not really needed.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Fri, 6 Jul 2012 14:03:08 +0000 (09:03 -0500)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Fri, 6 Jul 2012 14:03:08 +0000 (09:03 -0500)
mediagoblin/tools/files.py

index 0e8dc1e944b17cbc2fca7ab8f3a531f707cc69bd..315ff5e0b0f43af2c91cb8e7ecf91d9afca1aab4 100644 (file)
 
 from mediagoblin import mg_globals
 
-import os
-
-def _jointhat(thing):
-    if type(thing) == type(list()) or\
-            type(thing) == type(tuple()):
-        filepath = ""
-        for item in thing:
-            filepath = os.path.join(filepath, item)
-        return filepath
-    else:
-        raise TypeError, "expecting a list or tuple, {0} received".format(
-            str(type(thing)))
 
 def delete_media_files(media):
     """
@@ -42,14 +30,14 @@ def delete_media_files(media):
             mg_globals.public_store.delete_file(
                 listpath)
         except OSError:
-            no_such_files.append(_jointhat(listpath))
+            no_such_files.append("/".join(listpath))
 
     for attachment in media.attachment_files:
         try:
             mg_globals.public_store.delete_file(
                 attachment['filepath'])
         except OSError:
-            no_such_files.append(_jointhat(attachment))
+            no_such_files.append("/".join(attachment))
 
     if no_such_files:
         # This breaks pep8 as far as I know