combox

split and encrypted files between online file storage providers
git clone git://git.ricketyspace.net/combox.git
Log | Files | Refs

commit 115df22474879c0c4cd418c5956247d3c5c721f9
parent 2511b80565206f40f7059376ab876999c7adaae7
Author: Siddharth Ravikumar <sravik@bgsu.edu>
Date:   Thu, 26 Feb 2015 02:03:39 -0500

modded combox.crypto.decrypt_and_glue - added new arg called `write'

- 'write' is set to True by set default.
- If `write' is set, then the reconstructed file content is written to disk.

Diffstat:
combox/crypto.py | 11+++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/combox/crypto.py b/combox/crypto.py @@ -127,14 +127,14 @@ def split_and_encrypt(fpath, config, fcontent=None): write_shards(ciphered_shards, nodes, f_basename) -def decrypt_and_glue(fpath, config): +def decrypt_and_glue(fpath, config, write=True): """ Reads encrypted shards, decrypts and glues them. fpath: The path to file that has to be decrypted & glued from the nodes. config: The dictionary containing the combox configuration information. - + write: If set, writes the reconstructed file's content to disk. """ rel_path = relative_path(fpath, config) @@ -152,5 +152,8 @@ def decrypt_and_glue(fpath, config): # glue them together f_content = glue_data(f_parts) - # write the glued content to fpath - write_file(f, f_content) + if write: + # write the glued content to fpath + write_file(f, f_content) + + return f_content