mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-02 10:15:50 +00:00
Merge pull request #46 from mondonc/master
Avoid error when status_path dir doesn't exist
This commit is contained in:
commit
9a30d2fd24
1 changed files with 6 additions and 1 deletions
|
|
@ -74,7 +74,12 @@ def load_status(basepath, pair_name):
|
|||
|
||||
|
||||
def save_status(basepath, pair_name, status):
|
||||
full_path = os.path.join(expand_path(basepath), pair_name)
|
||||
base_path = expand_path(basepath)
|
||||
full_path = os.path.join(base_path, pair_name)
|
||||
|
||||
if not os.path.exists(base_path):
|
||||
os.makedirs(base_path)
|
||||
|
||||
with open(full_path, 'w+') as f:
|
||||
for k, v in status.items():
|
||||
json.dump((k, v), f)
|
||||
|
|
|
|||
Loading…
Reference in a new issue