Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
htmllib Namespace Reference

Data Structures

class  HTMLParser
 

Functions

def test
 

Variables

list __all__ = ["HTMLParser"]
 

Detailed Description

HTML 2.0 parser.

See the HTML 2.0 specification:
http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html

Function Documentation

def htmllib.test (   args = None)

Definition at line 386 of file htmllib.py.

387 def test(args = None):
388  import sys, formatter
389 
390  if not args:
391  args = sys.argv[1:]
392 
393  silent = args and args[0] == '-s'
394  if silent:
395  del args[0]
396 
397  if args:
398  file = args[0]
399  else:
400  file = 'test.html'
401 
402  if file == '-':
403  f = sys.stdin
404  else:
405  try:
406  f = open(file, 'r')
407  except IOError, msg:
408  print file, ":", msg
409  sys.exit(1)
410 
411  data = f.read()
412 
413  if f is not sys.stdin:
414  f.close()
415 
416  if silent:
418  else:
420 
421  p = HTMLParser(f)
422  p.feed(data)
423  p.close()
424 

Variable Documentation

list __all__ = ["HTMLParser"]

Definition at line 11 of file htmllib.py.