Package openid :: 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) source code
 
substituteEntities(s) source code
str
findHTMLMeta(stream)
Look for a meta http-equiv tag with the YADIS header name.
source code
Variables [hide private]
  CHUNK_SIZE = 16384
  re_flags = 98
  ent_pat = '\n&\n\n(?: \\#x (?P<hex> [a-f0-9]+ )\n| \\# (?P<d...
  ent_re = re.compile(r'(?iux)&(?:#x(?P<hex>[a-f0-9]+)|#(?P<dec>...
  __package__ = 'openid.yadis'
Function Details [hide private]

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]

ent_pat

Value:
'''
&

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

...

ent_re

Value:
re.compile(r'(?iux)&(?:#x(?P<hex>[a-f0-9]+)|#(?P<dec>\d+)|(?P<word>\w+\
));')