Skip to content

Commit

Permalink
Add some packaging instructions
Browse files Browse the repository at this point in the history
--HG--
extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40514
  • Loading branch information
jgraham committed Mar 1, 2007
1 parent 27eb4f2 commit 659ecd5
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 0 deletions.
34 changes: 34 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from distutils.core import setup

long_description="""HTML parser designed to follow the WHATWG HTML5
specification. The parser is designed to handle all flavours of HTML and
parses invalid documents using well-defined error handling rules compatible
with the behaviour of major desktop web browsers.
Output is to a tree structure; the current release supports output to
a custom tree similar to DOM and to ElementTree.
"""

classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Text Processing :: Markup :: HTML'
],

setup(name='html5lib',
version='0.2',
url='http:https://code.google.com/p/html5lib/',
license="MIT License",
description='HTML parser based on the WHAT-WG Web Applications 1.0'
'("HTML5") specifcation',
long_description=long_description,
classifiers=classifiers,
maintainer='James Graham',
maintainer_email='[email protected]',
packages=['html5lib', 'html5lib.treebuilders'],
package_dir = {'html5lib': 'src'}
)
6 changes: 6 additions & 0 deletions tests/test_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@
import new
import codecs

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

import inputstream
#END RELEASE

#RELEASE add
#import html5lib
#from html5lib import inputstream
#END RELEASE

def parseTestcase(testString):
testString = testString.split("\n")
Expand Down
8 changes: 8 additions & 0 deletions tests/test_lxp.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
#RELEASE remove
if __name__ == '__main__':
import os, sys
os.chdir(os.path.split(os.path.abspath(__file__))[0])
sys.path.insert(0, os.path.abspath(os.path.join(os.pardir, "src")))

from liberalxmlparser import *
from treebuilders import dom
#END RELEASE

#RELEASE add
#import html5lib
#from html5lib.treebuilders import dom
#from html5lib.liberalxmlparser import *
#END RELEASE

import unittest, re

Expand Down
8 changes: 8 additions & 0 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import unittest
import new

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

from treebuilders import simpletree, etreefull, dom
#END RELEASE

#RELEASE add
#import html5lib
#from html5lib import html5parser
#from html5lib.treebuilders import simpletree, etreefull, dom
#END RELEASE

treetypes = {"simpletree":simpletree.TreeBuilder,
"DOM":dom.TreeBuilder}
Expand Down
8 changes: 8 additions & 0 deletions tests/test_sax.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,21 @@

PREFERRED_XML_PARSERS = ["drv_libxml2"]

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

from liberalxmlparser import *
from treebuilders import dom
#END RELEASE

#RELEASE add
#import html5lib
#from html5lib.treebuilders import dom
#from html5lib.liberalxmlparser import *
#END RELEASE

class SAXLogger:
def __init__(self):
Expand Down
8 changes: 8 additions & 0 deletions tests/test_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,20 @@ def load(f):
return eval(input)
load = staticmethod(load)

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

from tokenizer import HTMLTokenizer
import constants
#END RELEASE

#RELEASE add
#import html5lib
#from html5lib.tokenizer import HTMLTokenizer
#from html5lib import constants
#END RELEASE

class TokenizerTestParser(object):
def __init__(self, contentModelFlag, lastStartTag=None):
Expand Down

0 comments on commit 659ecd5

Please sign in to comment.