parameters: ()
docstring: Add template to specified page object (wikitools)
docstring_summary: Add template to specified page object (wikitools)
docstring_tokens: Add template to specified page object ( wikitools )
function: def ConvertFilesToRst():	
      """
      Add template to specified page object (wikitools)
      """
      indexfiletext='============================\nWiki snapshot (ready-for-review)\n============================\n\n%s\n.. toctree::\n    :maxdepth: 2\n' % snapshot_version_information
      for file in os.listdir(wiki_temp_directory):
          if file.endswith(".md"):
              print file
              #get name of file
              filenamestripped=file.replace('.md','')
              indexfiletext+='\n    %s' % filenamestripped
              inputfilename=wiki_temp_directory+file
              outputfilename=wiki_directory+filenamestripped+'.rst'
              #
              command='pandoc -f markdown -t rst -o %s %s' % (outputfilename,inputfilename)
              print command
              os.system(command)
              title=filenamestripped.replace('-',' ')
              #print title
              logfile.write('title from filename: %s \n' % title)
              #add import message to title
              title+=' (wiki-import)'
              length=len(title)
              #print length
              headerbar=''
              for number in range(length):
                  headerbar+='='
              page_reference=filenamestripped
              page_reference_link_text = '.. _%s:\n\n' % page_reference
              titlebar=page_reference_link_text+headerbar+'\n'+title+'\n'+headerbar+'\n'
              textinfile=''
              # Add titlebar to start of the file (from the filename)
              textinfile+=titlebar
              # Add wiki snapshot information
              
              textinfile+=snapshot_version_information
                
              infile=open(outputfilename,'r')
              
              for line in infile:
                  textinfile+=line
              infile.close()
              #print textinfile
              
              outfile=open(outputfilename,'w')
              outfile.write(textinfile)
              outfile.close()
              #write the index
              outfile=open(wiki_directory+'index.rst','w')
              outfile.write(indexfiletext)
              outfile.close()
function_tokens: def ConvertFilesToRst ( ) : indexfiletext = '============================\nWiki snapshot (ready-for-review)\n============================\n\n%s\n.. toctree::\n    :maxdepth: 2\n' % snapshot_version_information for file in os . listdir ( wiki_temp_directory ) : if file . endswith ( ".md" ) : print file #get name of file filenamestripped = file . replace ( '.md' , '' ) indexfiletext += '\n    %s' % filenamestripped inputfilename = wiki_temp_directory + file outputfilename = wiki_directory + filenamestripped + '.rst' # command = 'pandoc -f markdown -t rst -o %s %s' % ( outputfilename , inputfilename ) print command os . system ( command ) title = filenamestripped . replace ( '-' , ' ' ) #print title logfile . write ( 'title from filename: %s \n' % title ) #add import message to title title += ' (wiki-import)' length = len ( title ) #print length headerbar = '' for number in range ( length ) : headerbar += '=' page_reference = filenamestripped page_reference_link_text = '.. _%s:\n\n' % page_reference titlebar = page_reference_link_text + headerbar + '\n' + title + '\n' + headerbar + '\n' textinfile = '' # Add titlebar to start of the file (from the filename) textinfile += titlebar # Add wiki snapshot information textinfile += snapshot_version_information infile = open ( outputfilename , 'r' ) for line in infile : textinfile += line infile . close ( ) #print textinfile outfile = open ( outputfilename , 'w' ) outfile . write ( textinfile ) outfile . close ( ) #write the index outfile = open ( wiki_directory + 'index.rst' , 'w' ) outfile . write ( indexfiletext ) outfile . close ( )