Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit205aced

Browse files
author
James Graham
committed
rearrage directory structure
1 parentac090d1 commit205aced

File tree

8 files changed

+39
-215
lines changed

8 files changed

+39
-215
lines changed

‎html5-tests.patch

Lines changed: 0 additions & 145 deletions
This file was deleted.

‎html5lib/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
f = open("my_document.html")
1111
tree = html5lib.parse(f)
1212
"""
13-
__version__="%(version)s"
13+
__version__="0.95-dev"
1414
fromhtml5parserimportHTMLParser,parse,parseFragment
1515
fromtreebuildersimportgetTreeBuilder
1616
fromtreewalkersimportgetTreeWalker

‎html5lib/tests/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1+
importsys
2+
importos
3+
4+
parent_path=os.path.abspath(os.path.join(os.path.split(__file__)[0],".."))
5+
6+
ifnotparent_pathinsys.path:
7+
sys.path.insert(0,parent_path)
8+
delparent_path
9+
110
fromruntestsimportbuildTestSuite
11+
12+
importsupport

‎html5lib/tests/runtests.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
importglob
44
importunittest
55

6-
#Allow us to import the parent module
7-
os.chdir(os.path.split(os.path.abspath(__file__))[0])
8-
sys.path.insert(0,os.path.abspath(os.curdir))
9-
sys.path.insert(0,os.path.abspath(os.pardir))
10-
sys.path.insert(0,os.path.join(os.path.abspath(os.pardir),"src"))
11-
126
defbuildTestSuite():
137
suite=unittest.TestSuite()
148
fortestcaseinglob.glob('test_*.py'):

‎html5lib/tests/support.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22
importsys
33
importglob
44

5-
#Allow us to import the parent module
6-
os.chdir(os.path.split(os.path.abspath(__file__))[0])
7-
sys.path.insert(0,os.path.abspath(os.path.join(os.pardir,"src")))
8-
95
importhtml5lib
106
fromhtml5libimporthtml5parser,treebuilders
117

12-
#Define the location of the tests as this changes in release versions
13-
#RELEASE remove
14-
test_dir=os.path.join(os.path.pardir,os.path.pardir,'testdata')
15-
#END RELEASE
16-
#RELEASE add
17-
#test_dir = './testdata'
18-
#END RELEASE
8+
base_path=os.path.split(__file__)[0]
9+
ifos.path.exists(os.path.join(base_path,'testdata')):
10+
#release
11+
test_dir=os.path.join(base_path,'testdata')
12+
else:
13+
#development
14+
test_dir=os.path.abspath(
15+
os.path.join(base_path,
16+
os.path.pardir,os.path.pardir,
17+
os.path.pardir,'testdata'))
18+
assertos.path.exists(test_dir),"Test data not found"
19+
20+
delbase_path
21+
1922
importsimplejson
2023

2124
#Build a dict of avaliable trees

‎html5lib/treebuilders/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333
treeBuilderCache= {}
3434

35+
importsys
36+
3537
defgetTreeBuilder(treeType,implementation=None,**kwargs):
3638
"""Get a TreeBuilder class for various types of tree with built-in support
3739

‎setup.py

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
try:
2-
fromsetuptoolsimportsetup
3-
exceptImportError:
4-
fromdistutils.coreimportsetup
1+
fromsetuptoolsimportsetup
52
importos
63

7-
long_description="""HTML parser designed to follow the HTML5
4+
long_description="""HTML parser designed to follow theWHATWGHTML5
85
specification. The parser is designed to handle all flavours of HTML and
96
parses invalid documents using well-defined error handling rules compatible
107
with the behaviour of major desktop web browsers.
118
129
Output is to a tree structure; the current release supports output to
13-
DOM, ElementTreeandlxml tree formats as well as a
10+
DOM, ElementTree, lxmlandBeautifulSoup tree formats as well as a
1411
simple custom format"""
1512

1613
classifiers=[
17-
'Development Status ::%(status)s',
14+
'Development Status ::5 - Production/Stable',
1815
'Intended Audience :: Developers',
1916
'License :: OSI Approved :: MIT License',
2017
'Operating System :: OS Independent',
@@ -24,17 +21,19 @@
2421
]
2522

2623
setup(name='html5lib',
27-
version='%(version)s',
24+
version='0.95-dev',
2825
url='http://code.google.com/p/html5lib/',
2926
license="MIT License",
30-
description='HTML parser based on the HTML5 specifcation',
27+
description='HTML parser based on the WHAT-WG Web Applications 1.0'
28+
'("HTML5") specifcation',
3129
long_description=long_description,
3230
classifiers=classifiers,
3331
maintainer='James Graham',
3432
maintainer_email='james@hoppipolla.co.uk',
3533
packages=['html5lib']+ ['html5lib.'+name
36-
fornameinos.listdir(os.path.join('src','html5lib'))
37-
ifos.path.isdir(os.path.join('src','html5lib',name))and
34+
fornameinos.listdir(os.path.join('html5lib'))
35+
ifos.path.isdir(os.path.join('html5lib',name))and
3836
notname.startswith('.')],
39-
package_dir= {'html5lib':os.path.join('src','html5lib')},
37+
test_suite="html5lib.tests.buildTestSuite",
38+
tests_require= ['simplejson']
4039
)

‎setup_base.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp