X-Git-Url: http://git.veekun.com/zzz-floof.git/blobdiff_plain/17b3828d837e1ccea92e08bd8c2ae84089add658..6371c50c3b414c0bb06a6144cd31803a1363a602:/floof/lib/file_storage.py diff --git a/floof/lib/file_storage.py b/floof/lib/file_storage.py index 4469394..90561d0 100644 --- a/floof/lib/file_storage.py +++ b/floof/lib/file_storage.py @@ -20,21 +20,21 @@ guess_type(temp.filename)[0] def get_path(space, hash): return "/" + os.path.join( space, hash[:2], hash[2:] ) - -def save_file(space, temp): - + +def save_file(space, temp): + dest_root = os.path.join( config['app_conf']['static_root'], space ) - + # we don't know where we're going to save this stuff yet, # so I guess we'll write it to another tempfile. One we know the path of. - # I'm assuming the tempfile we get from pylons is set to delete itself + # I'm assuming the tempfile we get from pylons is set to delete itself # when it closes, and has no visible path. Maybe I'm wrong? intermediate_file_descriptor, intermediate_path = tempfile.mkstemp() - + # that function gives me an integer file descriptor for some reason. intermediate_file = os.fdopen(intermediate_file_descriptor, "wb") - + sha1 = hashlib.sha1() while 1: data = temp.file.read(chunk_size)