6.14.10.14.2. Heading Helper closeLevels

Currently, we are nested some number of levels into the document as indicated by self.currentLevel. Our task is to close off all levels up to and including newLevel.

Comienzo python section to interscript/weavers/lout.py[24 /34 ] Siguiente Previo Primero Ăšltimo
   325: #line 673 "lout_weaver.ipk"
   326:     def closeLevels(self, newLevel):
   327:         assert newLevel <= self.currentLevel, \
   328:             "Incorrect closeLevels call (%d, current is %d)" % \
   329:             (newLevel, self.currentLevel)
   330:         if self.withinCode:
   331:             self.code_foot(self.withinCode[0], self.withinCode[1])
   332:         while self.currentLevel > newLevel:
   333:             lev = self.currentLevel - 1
   334:             sectionType = self.sectionLevels[lev]
   335:             self._writeline("@End @%s" % sectionType)
   336:             if self.documentClass == 'doc' or lev > 0:
   337:                 self._writeline("@End%ss" % sectionType)
   338:             self.currentLevel = lev
   339:         return
End python section to interscript/weavers/lout.py[24]