combox

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

commit 84a74768c00ade0c7ca44cb72b9b32f103653333
parent 3a0a9857b116cacda9ac658b5410f80857cf29da
Author: Siddharth Ravikumar <sravik@bgsu.edu>
Date:   Mon, 11 Jan 2016 18:28:48 -0500

combox/config.py: modified config_cb function.

The combox configuration directory creation is now done after reading
all the configuration values; the function also creates the combox
directory if it does not already exist.

Diffstat:
ChangeLog | 4++++
combox/config.py | 13+++++++++----
2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -3,6 +3,10 @@ * combox/cbox.py: Now, combox starts configuration when the configuration directory does not exist or when the configuration file does not exist. + * combox/config.py (config_cb): The combox configuration directory + creation is now done after reading all the configuration values; + the function also creates the combox directory if it does not + already exist. 2016-01-10 Siddharth Ravikumar <sravik@bgsu.edu> diff --git a/combox/config.py b/combox/config.py @@ -110,10 +110,6 @@ def config_cb(config_dir = path.join(expanduser("~"), '.combox'), :rtype: dict """ - - if not path.exists(config_dir): - # Create combox dir. - os.mkdir(config_dir, 0700) config_file_path = path.join(config_dir, 'config.yaml') config_info = {} @@ -144,6 +140,15 @@ def config_cb(config_dir = path.join(expanduser("~"), '.combox'), os.makedirs(nodes[node_name]['path']) config_info['nodes_info'] = nodes + + if not path.exists(config_dir): + # Create combox config directory. + os.mkdir(config_dir, 0700) + + if not path.exists(config_info['combox_dir']): + # Create combox directory. + os.makedirs(config_info['combox_dir']) + if write: config_file = open(config_file_path, 'w') yaml.dump(config_info, config_file, default_flow_style=False)