6.14.6.2.2. section processor

Process code sections.
Start python section to interscript/weavers/web.py[3 /8 ] Next Prev First Last
   246: #line 335 "web_weaver.ipk"
   247:   def _write_section_ref(self, filename, i, text=None):
   248:     if not text: text = str(i)
   249:     name = filename + '['+str(i)+']'
   250:     anchor = self.get_anchor(name)
   251:     if anchor:
   252:       anchor = '<A HREF="'+anchor+'">'+text+'</A>'
   253:       self._writeline (anchor+' ')
   254: 
   255:   def code_head(self,tangler, secno):
   256:     dst_filename = tangler.sink.name
   257:     self.set_anchor(dst_filename+'['+str(secno)+']')
   258:     self._endmode()
   259:     filename =tangler.sink.get_sink_name()
   260:     language = tangler.get_language()
   261:     dict = self.master.section_index
   262:     if dict.has_key(filename):
   263:       nsections = len(dict[filename])
   264:     else: nsections = 0
   265:     w = self._write
   266:     wl = self._writeline
   267:     w ( '<DIV CLASS="CODE_SECTION_HEAD"><SMALL>'+self.tr_phrase('Start')+' <EM>'+\
   268:       language+'</EM> section to <STRONG>'+\
   269:       filename+'['+str(secno))
   270:     if nsections: w('/'+str(nsections))
   271:     w(']</STRONG></SMALL>')
   272: 
   273:     if nsections:
   274:       if secno != nsections:
   275:         self._write_section_ref(filename, secno+1, self.tr_phrase('Next'))
   276:       if secno!=1:
   277:         self._write_section_ref(filename, secno-1, self.tr_phrase('Prev'))
   278:       if secno !=1:
   279:         self._write_section_ref(filename, 1, self.tr_phrase('First'))
   280:       if secno != nsections:
   281:         self._write_section_ref(filename, nsections, self.tr_phrase('Last'))
   282:     wl ('</DIV>')
   283:     wl ( '<DIV CLASS="CODE">')
   284: 
End python section to interscript/weavers/web.py[3]