From 59e15f3001f01ed1479477174d7a2856f0480818 Mon Sep 17 00:00:00 2001 From: BigBlueHat Date: Mon, 3 Nov 2014 09:48:44 -0500 Subject: [PATCH] Handle path separator differences --- situp.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/situp.py b/situp.py index ba01669..dc81143 100755 --- a/situp.py +++ b/situp.py @@ -394,6 +394,8 @@ def _attach(self, afile, file_path, minify=False): data = base64.encodestring(f.read()) f.close() + if os.path.sep in afile: + afile = '/'.join(afile.split(os.path.sep)) return {afile: { 'data': data, 'content_type': mime @@ -425,7 +427,8 @@ def recurse_update(a_dict, b_dict): attachments = {} app = {'_id': '_design/%s' % name} for root, dirs, files in os.walk(design): - path = root.split(name)[1].split('/')[1:] + path = root.split(os.path.join('_design', name))[1]\ + .split(os.path.sep)[1:] dirs = filter(self._allowed_file, dirs) if files: d = {}