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

Data Structures

class  SGMLParseError
 
class  SGMLParser
 
class  TestSGMLParser
 

Functions

def test
 

Variables

list __all__ = ["SGMLParser"]
 
tuple interesting = re.compile('[&<]')
 
tuple incomplete
 
tuple entityref = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]')
 
tuple charref = re.compile('&#([0-9]+)[^0-9]')
 
tuple starttagopen = re.compile('<[>a-zA-Z]')
 
tuple shorttagopen = re.compile('<[a-zA-Z][-.a-zA-Z0-9]*/')
 
tuple shorttag = re.compile('<([a-zA-Z][-.a-zA-Z0-9]*)/([^/]*)/')
 
tuple piclose = re.compile('>')
 
tuple endbracket = re.compile('[<>]')
 
tuple commentclose = re.compile(r'--\s*>')
 
tuple tagfind = re.compile('[a-zA-Z][-_.a-zA-Z0-9]*')
 
tuple attrfind
 

Detailed Description

A parser for SGML, using the derived class as a static DTD.

Function Documentation

def sgmllib.test (   args = None)

Definition at line 479 of file sgmllib.py.

References aifc.open().

480 def test(args = None):
481  import sys
482 
483  if not args:
484  args = sys.argv[1:]
485 
486  if args and args[0] == '-s':
487  args = args[1:]
488  klass = SGMLParser
489  else:
490  klass = TestSGMLParser
491 
492  if args:
493  file = args[0]
494  else:
495  file = 'test.html'
496 
497  if file == '-':
498  f = sys.stdin
499  else:
500  try:
501  f = open(file, 'r')
502  except IOError, msg:
503  print file, ":", msg
504  sys.exit(1)
505 
506  data = f.read()
507  if f is not sys.stdin:
508  f.close()
509 
510  x = klass()
511  for c in data:
512  x.feed(c)
513  x.close()
514 

Variable Documentation

list __all__ = ["SGMLParser"]

Definition at line 15 of file sgmllib.py.

tuple attrfind
Initial value:
1 = re.compile(
2  r'\s*([a-zA-Z_][-:.a-zA-Z_0-9]*)(\s*=\s*'
3  r'(\'[^\']*\'|"[^"]*"|[-a-zA-Z0-9./:;+*%?!&$\(\)_#=~\'"]*))?')

Definition at line 35 of file sgmllib.py.

tuple charref = re.compile('&#([0-9]+)[^0-9]')

Definition at line 26 of file sgmllib.py.

tuple commentclose = re.compile(r'--\s*>')

Definition at line 33 of file sgmllib.py.

tuple endbracket = re.compile('[<>]')

Definition at line 32 of file sgmllib.py.

tuple entityref = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]')

Definition at line 25 of file sgmllib.py.

tuple incomplete
Initial value:
1 = re.compile('&([a-zA-Z][a-zA-Z0-9]*|#[0-9]*)?|'
2  '<([a-zA-Z][^<>]*|'
3  '/([a-zA-Z][^<>]*)?|'
4  '![^<>]*)?')

Definition at line 20 of file sgmllib.py.

tuple interesting = re.compile('[&<]')

Definition at line 19 of file sgmllib.py.

tuple piclose = re.compile('>')

Definition at line 31 of file sgmllib.py.

tuple shorttag = re.compile('<([a-zA-Z][-.a-zA-Z0-9]*)/([^/]*)/')

Definition at line 30 of file sgmllib.py.

tuple shorttagopen = re.compile('<[a-zA-Z][-.a-zA-Z0-9]*/')

Definition at line 29 of file sgmllib.py.

tuple starttagopen = re.compile('<[>a-zA-Z]')

Definition at line 28 of file sgmllib.py.

tuple tagfind = re.compile('[a-zA-Z][-_.a-zA-Z0-9]*')

Definition at line 34 of file sgmllib.py.