Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
texi2html.HTMLNode Class Reference
Inheritance diagram for texi2html.HTMLNode:
Inheritance graph
[legend]
Collaboration diagram for texi2html.HTMLNode:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def write
def flush
def link
def finalize
def open_links
def close_links
def output_links

Public Attributes

 dirname
 name
 topname
 title
 next
 prev
 up
 lines
 text
 prologue
 epilogue

Static Public Attributes

string DOCTYPE = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">'
int type = 0
string cont = ''
string epilogue = '</BODY></HTML>\n'

Detailed Description

Some of the parser's functionality is separated into this class.

A Node accumulates its contents, takes care of links to other Nodes
and saves itself when it is finished and all links are resolved.

Definition at line 90 of file texi2html.py.


Constructor & Destructor Documentation

def texi2html.HTMLNode.__init__ (   self,
  dir,
  name,
  topname,
  title,
  next,
  prev,
  up 
)

Definition at line 103 of file texi2html.py.

00103 
00104     def __init__(self, dir, name, topname, title, next, prev, up):
00105         self.dirname = dir
00106         self.name = name
00107         if topname:
00108             self.topname = topname
00109         else:
00110             self.topname = name
00111         self.title = title
00112         self.next = next
00113         self.prev = prev
00114         self.up = up
00115         self.lines = []


Member Function Documentation

Reimplemented in texi2html.HTML3Node.

Definition at line 168 of file texi2html.py.

00168 
00169     def close_links(self):
00170         self.write('<HR>\n')

Definition at line 140 of file texi2html.py.

00140 
00141     def finalize(self):
00142         length = len(self.lines)
00143         self.text = ''.join(self.lines)
00144         self.lines = []
00145         self.open_links()
00146         self.output_links()
00147         self.close_links()
00148         links = ''.join(self.lines)
00149         self.lines = []
00150         self.prologue = (
00151             self.DOCTYPE +
00152             '\n<HTML><HEAD>\n'
00153             '  <!-- Converted with texi2html and Python -->\n'
00154             '  <TITLE>' + self.title + '</TITLE>\n'
00155             '  <LINK REL=Next HREF="'
00156                 + makefile(self.next) + '" TITLE="' + self.next + '">\n'
00157             '  <LINK REL=Previous HREF="'
00158                 + makefile(self.prev) + '" TITLE="' + self.prev  + '">\n'
00159             '  <LINK REL=Up HREF="'
00160                 + makefile(self.up) + '" TITLE="' + self.up  + '">\n'
00161             '</HEAD><BODY>\n' +
00162             links)
00163         if length > 20:
00164             self.epilogue = '<P>\n%s</BODY></HTML>\n' % links

def texi2html.HTMLNode.flush (   self)

Definition at line 120 of file texi2html.py.

00120 
00121     def flush(self):
00122         fp = open(self.dirname + '/' + makefile(self.name), 'w')
00123         fp.write(self.prologue)
00124         fp.write(self.text)
00125         fp.write(self.epilogue)
00126         fp.close()

Here is the call graph for this function:

Here is the caller graph for this function:

def texi2html.HTMLNode.link (   self,
  label,
  nodename,
  rel = None,
  rev = None 
)

Definition at line 127 of file texi2html.py.

00127 
00128     def link(self, label, nodename, rel=None, rev=None):
00129         if nodename:
00130             if nodename.lower() == '(dir)':
00131                 addr = '../dir.html'
00132                 title = ''
00133             else:
00134                 addr = makefile(nodename)
00135                 title = ' TITLE="%s"' % nodename
00136             self.write(label, ': <A HREF="', addr, '"', \
00137                        rel and (' REL=' + rel) or "", \
00138                        rev and (' REV=' + rev) or "", \
00139                        title, '>', nodename, '</A>  \n')

Here is the caller graph for this function:

Reimplemented in texi2html.HTML3Node.

Definition at line 165 of file texi2html.py.

00165 
00166     def open_links(self):
00167         self.write('<HR>\n')

Definition at line 171 of file texi2html.py.

00171 
00172     def output_links(self):
00173         if self.cont != self.next:
00174             self.link('  Cont', self.cont)
00175         self.link('  Next', self.next, rel='Next')
00176         self.link('  Prev', self.prev, rel='Previous')
00177         self.link('  Up', self.up, rel='Up')
00178         if self.name != self.topname:
00179             self.link('  Top', self.topname)
00180 

Here is the call graph for this function:

def texi2html.HTMLNode.write (   self,
  lines 
)

Definition at line 116 of file texi2html.py.

00116 
00117     def write(self, *lines):
00118         for line in lines:
00119             self.lines.append(line)


Member Data Documentation

Definition at line 100 of file texi2html.py.

Definition at line 104 of file texi2html.py.

string texi2html.HTMLNode.DOCTYPE = '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">' [static]

Reimplemented in texi2html.HTML3Node.

Definition at line 97 of file texi2html.py.

string texi2html.HTMLNode.epilogue = '</BODY></HTML>\n' [static]

Definition at line 101 of file texi2html.py.

Definition at line 163 of file texi2html.py.

Definition at line 114 of file texi2html.py.

Definition at line 105 of file texi2html.py.

Definition at line 111 of file texi2html.py.

Definition at line 112 of file texi2html.py.

Definition at line 149 of file texi2html.py.

Definition at line 142 of file texi2html.py.

Definition at line 110 of file texi2html.py.

Definition at line 107 of file texi2html.py.

Definition at line 99 of file texi2html.py.

Definition at line 113 of file texi2html.py.


The documentation for this class was generated from the following file: