mirror of
https://github.com/readthedocs/sphinx-autoapi
synced 2024-11-11 19:10:58 +00:00
Only open files for writing
This commit is contained in:
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…
Reference in New Issue
Block a user