Package yadis :: Module parsehtml
[hide private]
[frames] | no frames]

Module parsehtml

source code

Classes [hide private]
  ParseDone
Exception to hold the URI that was located when the parse is finished.
  MetaNotFound
Exception to hold the content of the page if we did not find the appropriate <meta> tag
  YadisHTMLParser
Parser that finds a meta http-equiv tag in the head of a html document.

Functions [hide private]
  substituteMO(mo)
  substituteEntities(s)
str findHTMLMeta(stream)
Look for a meta http-equiv tag with the YADIS header name.

Variables [hide private]
  CHUNK_SIZE = 16384
  re_flags = 98
  ent_pat = '\n&\n\n(?: \\#x (?P<hex> [a-f0-9]+ )\n| \\# (?P<dec...
  ent_re = <_sre.SRE_Pattern object at 0x83f1df8>

Function Details [hide private]

substituteMO(mo)

source code 

substituteEntities(s)

source code 

findHTMLMeta(stream)

source code 

Look for a meta http-equiv tag with the YADIS header name.
Parameters:
  • stream (Object that implements a read() method that works like file.read) - Source of the html text
Returns: str
The URI from which to fetch the XRDS document
Raises:
  • MetaNotFound - raised with the content that was searched as the first parameter.

Variables Details [hide private]

CHUNK_SIZE

Value:
16384                                                                 
      

re_flags

Value:
98                                                                    
      

ent_pat

Value:
'''
&

(?: \\#x (?P<hex> [a-f0-9]+ )
|   \\# (?P<dec> \\d+ )
|   (?P<word> \\w+ )
)

...                                                                    
      

ent_re

Value:
&(?:#x([a-f0-9]+)|#(\d+)|(\w+));