File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 `
Original file line number Diff line number Diff line change 1414datad = {}
1515for 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
2828subdirs = datad .keys ()
2929subdirs .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####################
3636Matplotlib Examples
37- ###################
37+ ####################
3838
3939.. htmlonly::
4040
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 )
7373 fh .write ('\n \n ' )
7474 fh .close ()
7575
76-
76+
7777
7878fhindex .close ()
You can’t perform that action at this time.
0 commit comments