qBittorrent
nova3.sgmllib3 Namespace Reference

Classes

class  SGMLParseError
 
class  SGMLParser
 
class  TestSGMLParser
 

Functions

def test (args=None)
 

Variables

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

Detailed Description

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

Function Documentation

◆ test()

def nova3.sgmllib3.test (   args = None)

Definition at line 510 of file sgmllib3.py.

510 def test(args = None):
511  import sys
512 
513  if args is None:
514  args = sys.argv[1:]
515 
516  if args and args[0] == '-s':
517  args = args[1:]
518  klass = SGMLParser
519  else:
520  klass = TestSGMLParser
521 
522  if args:
523  file = args[0]
524  else:
525  file = 'test.html'
526 
527  if file == '-':
528  f = sys.stdin
529  else:
530  try:
531  f = open(file, 'r')
532  except IOError as msg:
533  print(file, ":", msg)
534  sys.exit(1)
535 
536  data = f.read()
537  if f is not sys.stdin:
538  f.close()
539 
540  x = klass()
541  for c in data:
542  x.feed(c)
543  x.close()
544 
545 
def test(args=None)
Definition: sgmllib3.py:510

Referenced by nsel_DISABLE_MSVC_WARNINGS(), and BitTorrent::Session.removeCategory().

Here is the caller graph for this function:

Variable Documentation

◆ __all__

list nova3.sgmllib3.__all__ = ["SGMLParser", "SGMLParseError"]
private

Definition at line 14 of file sgmllib3.py.

◆ attrfind

nova3.sgmllib3.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 33 of file sgmllib3.py.

◆ charref

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

Definition at line 25 of file sgmllib3.py.

◆ endbracket

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

Definition at line 31 of file sgmllib3.py.

◆ entityref

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

Definition at line 24 of file sgmllib3.py.

◆ incomplete

nova3.sgmllib3.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 19 of file sgmllib3.py.

◆ interesting

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

Definition at line 18 of file sgmllib3.py.

Referenced by BitTorrent::PeerInfo.isInteresting().

◆ piclose

nova3.sgmllib3.piclose = re.compile('>')

Definition at line 30 of file sgmllib3.py.

◆ shorttag

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

Definition at line 29 of file sgmllib3.py.

◆ shorttagopen

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

Definition at line 28 of file sgmllib3.py.

◆ starttagopen

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

Definition at line 27 of file sgmllib3.py.

◆ tagfind

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

Definition at line 32 of file sgmllib3.py.