Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 016622c

Browse files
committed
fixed gen_rst header
svn path=/trunk/matplotlib/; revision=6226
1 parent 5d3cdb7 commit 016622c

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

doc/contents.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Overview
2121
glossary/index.rst
2222

2323
.. htmlonly::
24+
examples/index.rst
2425

2526
* :ref:`genindex`
2627
* :ref:`modindex`

doc/examples/gen_rst.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
datad = {}
1515
for root, subFolders, files in os.walk(rootdir):
1616
for fname in files:
17-
if ( fname.startswith('.') or fname.startswith('#') or
18-
fname.find('.svn')>=0 or not fname.endswith('.py') ):
17+
if ( fname.startswith('.') or fname.startswith('#') or
18+
fname.find('.svn')>=0 or not fname.endswith('.py') ):
1919
continue
20-
20+
2121
fullpath = os.path.join(root,fname)
2222
contents = file(fullpath).read()
2323
# indent
@@ -28,13 +28,13 @@
2828
subdirs = datad.keys()
2929
subdirs.sort()
3030

31-
fhindex = file('index.rst')
32-
fh.index.write("""\
31+
fhindex = file('index.rst', 'w')
32+
fhindex.write("""\
3333
.. _examples-index:
3434
3535
####################
3636
Matplotlib Examples
37-
###################
37+
####################
3838
3939
.. htmlonly::
4040
@@ -59,7 +59,7 @@
5959
fh.write('*'*len(title) + '\n')
6060
fh.write(title + '\n')
6161
fh.write('*'*len(title) + '\n\n')
62-
62+
6363
for fname, contents in datad[subdir]:
6464
print ' ', fname
6565
basename, ext = os.path.splitext(fname)
@@ -73,6 +73,6 @@
7373
fh.write('\n\n')
7474
fh.close()
7575

76-
76+
7777

7878
fhindex.close()

0 commit comments

Comments
 (0)