Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Handle path separator differences
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBlueHat committed Nov 3, 2014
1 parent 219cb9f commit 59e15f3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion situp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = {}
Expand Down

0 comments on commit 59e15f3

Please sign in to comment.