combox

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

commit 30cf34bef72df235be4ada2e7b15afbeeb84dd23
parent d17974e00be1541aff4a646d17c83825e1527bbd
Author: Siddharth Ravikumar <sravik@bgsu.edu>
Date:   Tue, 13 Jan 2015 23:13:06 -0500

combox/config.py: added get_nodedirs function.

Diffstat:
combox/config.py | 16++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)

diff --git a/combox/config.py b/combox/config.py @@ -47,6 +47,8 @@ import hashlib import sys import stat +from os import path + def get_secret(): "Gets the pass phrase from std. input." return getpass.getpass('passphrase: ') @@ -91,3 +93,17 @@ def config_cb(config_dir = os.path.join(os.getenv('HOME'),'.combox/'), yaml.dump(config_info, config_file, default_flow_style=False) os.chmod(config_file_path,stat.S_IRUSR|stat.S_IWUSR) + +def get_nodedirs(config): + """ + Returns the node path to directories as a list. + + config: a dictionary which has the combox configuration + """ + nodes = [] + + for node in config['nodes_info'].itervalues(): + node_path = path.abspath(node['path']) + nodes.append(node_path) + + return sorted(nodes)