Skip to content

Commit 659ecd5

Browse files
committed
Add some packaging instructions
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40514
1 parent 27eb4f2 commit 659ecd5

File tree

6 files changed

+72
-0
lines changed

6 files changed

+72
-0
lines changed

setup.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
from distutils.core import setup
2+
3+
long_description="""HTML parser designed to follow the WHATWG HTML5
4+
specification. The parser is designed to handle all flavours of HTML and
5+
parses invalid documents using well-defined error handling rules compatible
6+
with the behaviour of major desktop web browsers.
7+
8+
Output is to a tree structure; the current release supports output to
9+
a custom tree similar to DOM and to ElementTree.
10+
"""
11+
12+
classifiers=[
13+
'Development Status :: 3 - Alpha',
14+
'Intended Audience :: Developers',
15+
'License :: OSI Approved :: MIT License',
16+
'Operating System :: OS Independent',
17+
'Programming Language :: Python',
18+
'Topic :: Software Development :: Libraries :: Python Modules',
19+
'Topic :: Text Processing :: Markup :: HTML'
20+
],
21+
22+
setup(name='html5lib',
23+
version='0.2',
24+
url='http://code.google.com/p/html5lib/',
25+
license="MIT License",
26+
description='HTML parser based on the WHAT-WG Web Applications 1.0'
27+
'("HTML5") specifcation',
28+
long_description=long_description,
29+
classifiers=classifiers,
30+
maintainer='James Graham',
31+
maintainer_email='jg307@cam.ac.uk',
32+
packages=['html5lib', 'html5lib.treebuilders'],
33+
package_dir = {'html5lib': 'src'}
34+
)

tests/test_encoding.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@
66
import new
77
import codecs
88

9+
#RELEASE remove
910
# XXX Allow us to import the sibling module
1011
os.chdir(os.path.split(os.path.abspath(__file__))[0])
1112
sys.path.insert(0, os.path.abspath(os.path.join(os.pardir, "src")))
1213

1314
import inputstream
15+
#END RELEASE
1416

17+
#RELEASE add
18+
#import html5lib
19+
#from html5lib import inputstream
20+
#END RELEASE
1521

1622
def parseTestcase(testString):
1723
testString = testString.split("\n")

tests/test_lxp.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1+
#RELEASE remove
12
if __name__ == '__main__':
23
import os, sys
34
os.chdir(os.path.split(os.path.abspath(__file__))[0])
45
sys.path.insert(0, os.path.abspath(os.path.join(os.pardir, "src")))
56

67
from liberalxmlparser import *
78
from treebuilders import dom
9+
#END RELEASE
10+
11+
#RELEASE add
12+
#import html5lib
13+
#from html5lib.treebuilders import dom
14+
#from html5lib.liberalxmlparser import *
15+
#END RELEASE
816

917
import unittest, re
1018

tests/test_parser.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import unittest
66
import new
77

8+
#RELEASE remove
89
# XXX Allow us to import the sibling module
910
os.chdir(os.path.split(os.path.abspath(__file__))[0])
1011
sys.path.insert(0, os.path.abspath(os.path.join(os.pardir, "src")))
@@ -14,6 +15,13 @@
1415
#XXX - it would be nice to automate finding all treebuilders or to allow running just one
1516

1617
from treebuilders import simpletree, etreefull, dom
18+
#END RELEASE
19+
20+
#RELEASE add
21+
#import html5lib
22+
#from html5lib import html5parser
23+
#from html5lib.treebuilders import simpletree, etreefull, dom
24+
#END RELEASE
1725

1826
treetypes = {"simpletree":simpletree.TreeBuilder,
1927
"DOM":dom.TreeBuilder}

tests/test_sax.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,21 @@
55

66
PREFERRED_XML_PARSERS = ["drv_libxml2"]
77

8+
#RELEASE remove
89
if __name__ == '__main__':
910
import os, sys
1011
os.chdir(os.path.split(os.path.abspath(__file__))[0])
1112
sys.path.insert(0, os.path.abspath(os.path.join(os.pardir, "src")))
1213

1314
from liberalxmlparser import *
1415
from treebuilders import dom
16+
#END RELEASE
17+
18+
#RELEASE add
19+
#import html5lib
20+
#from html5lib.treebuilders import dom
21+
#from html5lib.liberalxmlparser import *
22+
#END RELEASE
1523

1624
class SAXLogger:
1725
def __init__(self):

tests/test_tokenizer.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,20 @@ def load(f):
1616
return eval(input)
1717
load = staticmethod(load)
1818

19+
#RELEASE remove
1920
#Allow us to import the parent module
2021
os.chdir(os.path.split(os.path.abspath(__file__))[0])
2122
sys.path.insert(0, os.path.abspath(os.path.join(os.pardir, "src")))
2223

2324
from tokenizer import HTMLTokenizer
2425
import constants
26+
#END RELEASE
27+
28+
#RELEASE add
29+
#import html5lib
30+
#from html5lib.tokenizer import HTMLTokenizer
31+
#from html5lib import constants
32+
#END RELEASE
2533

2634
class TokenizerTestParser(object):
2735
def __init__(self, contentModelFlag, lastStartTag=None):

0 commit comments

Comments
 (0)