Removing _jointhat()... not really needed.
This commit is contained in:
parent
a850b1e2a2
commit
1ec85bb3de
@ -16,18 +16,6 @@
|
|||||||
|
|
||||||
from mediagoblin import mg_globals
|
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):
|
def delete_media_files(media):
|
||||||
"""
|
"""
|
||||||
@ -42,14 +30,14 @@ def delete_media_files(media):
|
|||||||
mg_globals.public_store.delete_file(
|
mg_globals.public_store.delete_file(
|
||||||
listpath)
|
listpath)
|
||||||
except OSError:
|
except OSError:
|
||||||
no_such_files.append(_jointhat(listpath))
|
no_such_files.append("/".join(listpath))
|
||||||
|
|
||||||
for attachment in media.attachment_files:
|
for attachment in media.attachment_files:
|
||||||
try:
|
try:
|
||||||
mg_globals.public_store.delete_file(
|
mg_globals.public_store.delete_file(
|
||||||
attachment['filepath'])
|
attachment['filepath'])
|
||||||
except OSError:
|
except OSError:
|
||||||
no_such_files.append(_jointhat(attachment))
|
no_such_files.append("/".join(attachment))
|
||||||
|
|
||||||
if no_such_files:
|
if no_such_files:
|
||||||
# This breaks pep8 as far as I know
|
# This breaks pep8 as far as I know
|
||||||
|
Loading…
x
Reference in New Issue
Block a user