| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,7 @@ | |||
| 1 | - from distutils.core import setup | ||
| 1 | + try: | ||
| 2 | + from setuptools import setup | ||
| 3 | + except ImportError: | ||
| 4 | + from distutils.core import setup | ||
| 2 | 5 | import os | |
| 3 | 6 | ||
| 4 | 7 | long_description="""HTML parser designed to follow the WHATWG HTML5 | |
@@ -7,11 +10,11 @@ | |||
| 7 | 10 | with the behaviour of major desktop web browsers. | |
| 8 | 11 | ||
| 9 | 12 | Output is to a tree structure; the current release supports output to | |
| 10 | - a custom tree similar to DOM and to ElementTree. | ||
| 11 | - """ | ||
| 13 | + DOM, ElementTree, lxml and BeautifulSoup tree formats as well as a | ||
| 14 | + simple custom format""" | ||
| 12 | 15 | ||
| 13 | 16 | classifiers=[ | |
| 14 | - 'Development Status :: 3 - Alpha', | ||
| 17 | + 'Development Status :: 4 - Beta', | ||
| 15 | 18 | 'Intended Audience :: Developers', | |
| 16 | 19 | 'License :: OSI Approved :: MIT License', | |
| 17 | 20 | 'Operating System :: OS Independent', | |
@@ -21,7 +24,7 @@ | |||
| 21 | 24 | ], | |
| 22 | 25 | ||
| 23 | 26 | setup(name='html5lib', | |
| 24 | - version='0.3', | ||
| 27 | + version='0.11', | ||
| 25 | 28 | url='http://code.google.com/p/html5lib/', | |
| 26 | 29 | license="MIT License", | |
| 27 | 30 | description='HTML parser based on the WHAT-WG Web Applications 1.0' | |
@@ -34,5 +37,7 @@ | |||
| 34 | 37 | for name in os.listdir(os.path.join('src','html5lib')) | |
| 35 | 38 | if os.path.isdir(os.path.join('src','html5lib',name)) and | |
| 36 | 39 | not name.startswith('.')], | |
| 37 | - package_dir = {'html5lib': 'src/html5lib'} | ||
| 40 | + package_dir = {'html5lib': 'src/html5lib'}, | ||
| 41 | + test_suite = "tests.buildTestSuite", | ||
| 42 | + tests_require = ['simplejson'] | ||
| 38 | 43 | ) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,8 +7,8 @@ | |||
| 7 | 7 | with the behaviour of major desktop web browsers. | |
| 8 | 8 | ||
| 9 | 9 | Output is to a tree structure; the current release supports output to | |
| 10 | - a custom tree similar to DOM and to ElementTree. | ||
| 11 | - """ | ||
| 10 | + DOM, ElementTree, lxml and BeautifulSoup tree formats as well as a | ||
| 11 | + simple custom format""" | ||
| 12 | 12 | ||
| 13 | 13 | classifiers=[ | |
| 14 | 14 | 'Development Status :: %(status)s', | |
@@ -34,7 +34,7 @@ | |||
| 34 | 34 | for name in os.listdir(os.path.join('src','html5lib')) | |
| 35 | 35 | if os.path.isdir(os.path.join('src','html5lib',name)) and | |
| 36 | 36 | not name.startswith('.')], | |
| 37 | - package_dir = {'html5lib': 'src/html5lib'}, | ||
| 37 | + package_dir = {'': 'src/'}, | ||
| 38 | 38 | test_suite = "tests.buildTestSuite", | |
| 39 | 39 | tests_require = ['simplejson'] | |
| 40 | 40 | ) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,6 +23,7 @@ def __init__(self, inDir, outDir, version="0", status=4, installDir="~"): | |||
| 23 | 23 | self.inDir = os.path.abspath(inDir) | |
| 24 | 24 | self.outDir = os.path.abspath(outDir) | |
| 25 | 25 | self.exclude = self.getExcludeList() | |
| 26 | + print self.exclude | ||
| 26 | 27 | self.fileList = self.getFileList() | |
| 27 | 28 | self.installDir = installDir | |
| 28 | 29 | self.outFiles = [] | |
@@ -45,12 +46,15 @@ def getExcludeList(self): | |||
| 45 | 46 | return rv | |
| 46 | 47 | ||
| 47 | 48 | def copyTestData(self): | |
| 48 | - outDir = "tests/testdata" | ||
| 49 | + outDir = os.path.join(self.inDir, "tests/testdata") | ||
| 50 | + print | ||
| 49 | 51 | try: | |
| 50 | 52 | os.mkdir(outDir) | |
| 51 | 53 | except OSError: | |
| 52 | - #the directory already exists | ||
| 53 | - pass | ||
| 54 | + #the directory already exists | ||
| 55 | + if not os.path.exists(outDir): | ||
| 56 | + raise | ||
| 57 | + | ||
| 54 | 58 | inBaseDir = os.path.abspath(os.path.join(self.inDir, "../testdata")) | |
| 55 | 59 | dirWalker = os.walk(inBaseDir) | |
| 56 | 60 | for (curDir, dirs, files) in dirWalker: | |
@@ -152,7 +156,8 @@ def test(self): | |||
| 152 | 156 | ||
| 153 | 157 | def makeZipFile(self): | |
| 154 | 158 | z = zipfile.ZipFile(os.path.join(self.outDir, | |
| 155 | - "html5lib-%s.zip"%self.version), 'w') | ||
| 159 | + "html5lib-%s.zip"%self.version), 'w', | ||
| 160 | + zipfile.ZIP_DEFLATED) | ||
| 156 | 161 | for f in self.outFiles: | |
| 157 | 162 | z.write(f, os.path.join("html5lib-%s"%self.version, | |
| 158 | 163 | f[len(self.outDir)+1:])) | |
@@ -226,4 +231,4 @@ def move(self, line): | |||
| 226 | 231 | dirName = os.path.dirname(dirName) | |
| 227 | 232 | ||
| 228 | 233 | for item in dirsToCreate[::-1]: | |
| 229 | - os.mkdir(item) | ||
| 234 | + os.mkdir(item) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments