parameters: (tocList)
docstring: Creates all the Table of Contents pages.
  
      Calls tocPageFramesBuild() to write the header and empty frame for the
      toc rows each time a new page is added.
      Then calls tocRowAdd() to add each line to the toc frame. Creates new page
      each time it completes last row on page.
docstring_summary: Creates all the Table of Contents pages.
docstring_tokens: Creates all the Table of Contents pages .
function: def build_toc(tocList):
      """Creates all the Table of Contents pages.
  
      Calls tocPageFramesBuild() to write the header and empty frame for the
      toc rows each time a new page is added.
      Then calls tocRowAdd() to add each line to the toc frame. Creates new page
      each time it completes last row on page.
      """
      rowCount = 0
      yPos = 0
      tocPageNum = 1
      tocPageCount = 1
  
      scribus.newPage(tocPageNum)
      isEvenPage = set_odd_even(tocPageNum)
      body = build_toc_page_template()             # create frames for new empty page
      if isEvenPage == 0:
          scribus.setTextAlignment(2, body)
      else:
          scribus.setTextAlignment(0, body)
      for i in tocList:
          if rowCount == dD['tocRowsPerPage']: # Need to build a new TOC page (count is from zero, not one)
              tocPageNum = tocPageNum + 1
              scribus.newPage(tocPageNum)
              isEvenPage = set_odd_even(tocPageNum)
              body = build_toc_page_template()
              if not isEvenPage:
                  scribus.setTextAlignment(2, body)
              else:
                  scribus.setTextAlignment(0, body)
              rowCount = 0
              yPos = 0
              tocPageCount = tocPageCount + 1
          yPos = insert_toc_row(i[0], i[1], yPos, body)
          rowCount = rowCount + 1
      if userPrefs['wantDoubleSided']:
          if tocPageCount % 2 != 0:           # Odd page
              tocPageNum = tocPageNum + 1
              scribus.newPage(tocPageNum)
function_tokens: def build_toc ( tocList ) : rowCount = 0 yPos = 0 tocPageNum = 1 tocPageCount = 1 scribus . newPage ( tocPageNum ) isEvenPage = set_odd_even ( tocPageNum ) body = build_toc_page_template ( ) # create frames for new empty page if isEvenPage == 0 : scribus . setTextAlignment ( 2 , body ) else : scribus . setTextAlignment ( 0 , body ) for i in tocList : if rowCount == dD [ 'tocRowsPerPage' ] : # Need to build a new TOC page (count is from zero, not one) tocPageNum = tocPageNum + 1 scribus . newPage ( tocPageNum ) isEvenPage = set_odd_even ( tocPageNum ) body = build_toc_page_template ( ) if not isEvenPage : scribus . setTextAlignment ( 2 , body ) else : scribus . setTextAlignment ( 0 , body ) rowCount = 0 yPos = 0 tocPageCount = tocPageCount + 1 yPos = insert_toc_row ( i [ 0 ] , i [ 1 ] , yPos , body ) rowCount = rowCount + 1 if userPrefs [ 'wantDoubleSided' ] : if tocPageCount % 2 != 0 : # Odd page tocPageNum = tocPageNum + 1 scribus . newPage ( tocPageNum )