Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
CMFDefault.utils.SimpleHTMLParser Class Reference
Inheritance diagram for CMFDefault.utils.SimpleHTMLParser:
Inheritance graph
[legend]
Collaboration diagram for CMFDefault.utils.SimpleHTMLParser:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def handle_data
def handle_charref
def handle_entityref
def save_bgn
def save_end
def start_title
def end_title
def do_meta
def unknown_startag
def unknown_endtag

Public Attributes

 savedata
 title
 metatags
 body

Detailed Description

Definition at line 162 of file utils.py.


Constructor & Destructor Documentation

def CMFDefault.utils.SimpleHTMLParser.__init__ (   self,
  verbose = 0 
)

Definition at line 166 of file utils.py.

00166 
00167     def __init__( self, verbose=0 ):
00168 
00169         SGMLParser.__init__( self, verbose )
00170         self.savedata = None
00171         self.title = ''
00172         self.metatags = {}
00173         self.body = ''


Member Function Documentation

def CMFDefault.utils.SimpleHTMLParser.do_meta (   self,
  attrs 
)

Definition at line 205 of file utils.py.

00205 
00206     def do_meta( self, attrs ):
00207 
00208         name = ''
00209         content = ''
00210 
00211         for attrname, value in attrs:
00212 
00213             value = value.strip()
00214 
00215             if attrname == "name":
00216                 name = value.capitalize()
00217 
00218             if attrname == "content":
00219                 content = value
00220 
00221         if name:
00222             self.metatags[ name ] = content

Definition at line 201 of file utils.py.

00201 
00202     def end_title( self ):
00203 
00204         self.title = self.save_end()

Here is the call graph for this function:

Definition at line 179 of file utils.py.

00179 
00180     def handle_charref( self, ref ):
00181 
00182         self.handle_data( "&#%s;" % ref )

Here is the call graph for this function:

Definition at line 174 of file utils.py.

00174 
00175     def handle_data( self, data ):
00176 
00177         if self.savedata is not None:
00178             self.savedata = self.savedata + data

Here is the caller graph for this function:

Definition at line 183 of file utils.py.

00183 
00184     def handle_entityref( self, ref ):
00185 
00186         self.handle_data( "&%s;" % ref )

Here is the call graph for this function:

Definition at line 187 of file utils.py.

00187 
00188     def save_bgn( self ):
00189 
00190         self.savedata = ''

Here is the caller graph for this function:

Definition at line 191 of file utils.py.

00191 
00192     def save_end( self ):
00193 
00194         data = self.savedata
00195         self.savedata = None
00196         return data

Here is the caller graph for this function:

def CMFDefault.utils.SimpleHTMLParser.start_title (   self,
  attrs 
)

Definition at line 197 of file utils.py.

00197 
00198     def start_title( self, attrs ):
00199 
00200         self.save_bgn()

Here is the call graph for this function:

Definition at line 227 of file utils.py.

00227 
00228     def unknown_endtag( self, tag ):
00229 
00230         self.setliteral()
00231 
00232 #
00233 #   HTML cleaning code
00234 #
00235 
# These are the HTML tags that we will leave intact
def CMFDefault.utils.SimpleHTMLParser.unknown_startag (   self,
  tag,
  attrs 
)

Definition at line 223 of file utils.py.

00223 
00224     def unknown_startag( self, tag, attrs ):
00225 
00226         self.setliteral()


Member Data Documentation

Definition at line 172 of file utils.py.

Definition at line 171 of file utils.py.

Definition at line 169 of file utils.py.

Definition at line 170 of file utils.py.


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