Only open files for writing

pull/20/head
Eric Holscher 9 years ago
parent 220599c22f
commit 999a031108

@ -184,12 +184,12 @@ class DotNetSphinxMapper(SphinxMapperBase):
detail_dir = os.path.join(root, *filename.split('.'))
ensuredir(detail_dir)
path = os.path.join(detail_dir, '%s%s' % ('index', source_suffix))
with open(path, 'wb+') as detail_file:
with open(path, 'wb') as detail_file:
detail_file.write(rst.encode('utf-8'))
# Render Top Index
top_level_index = os.path.join(root, 'index.rst')
with open(top_level_index, 'wb+') as top_level_file:
with open(top_level_index, 'wb') as top_level_file:
content = self.jinja_env.get_template('index.rst')
top_level_file.write(content.render(pages=self.namespaces.values()).encode('utf-8'))

Loading…
Cancel
Save