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

Commit143b0d4

Browse files
committed
Merge pull request#252 from gsnedders/drop_charade
Drop charade, cleanup setup.py; r=nobody!
2 parentscc99095 +5a62f05 commit143b0d4

File tree

7 files changed

+19
-29
lines changed

7 files changed

+19
-29
lines changed

‎CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ Released on XXX
4444
(instead of the tokenizer); as such, this will require amending all
4545
callers of it to use it via the treewalker API.**
4646

47+
* **Drop support of charade, now that chardet is supported once more.**
48+
4749

4850
0.9999999/1.0b8
4951
~~~~~~~~~~~~~~~

‎README.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,8 @@ functionality:
113113

114114
- ``genshi`` has a treewalker (but not builder); and
115115

116-
- ``charade`` can be used as a fallback when character encoding cannot
117-
be determined; ``chardet``, from which it was forked, can also be used
118-
on Python 2.
116+
- ``chardet`` can be used as a fallback when character encoding cannot
117+
be determined.
119118

120119
- ``ordereddict`` can be used under Python 2.6
121120
(``collections.OrderedDict`` is used instead on later versions) to

‎debug-info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"maxsize":sys.maxsize
1313
}
1414

15-
search_modules= ["charade","chardet","datrie","genshi","html5lib","lxml","six"]
15+
search_modules= ["chardet","datrie","genshi","html5lib","lxml","six"]
1616
found_modules= []
1717

1818
forminsearch_modules:

‎html5lib/inputstream.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,7 @@ def detectEncoding(self, parseMeta=True, chardet=True):
468468
ifencodingisNoneandchardet:
469469
confidence="tentative"
470470
try:
471-
try:
472-
fromcharade.universaldetectorimportUniversalDetector
473-
exceptImportError:
474-
fromchardet.universaldetectorimportUniversalDetector
471+
fromchardet.universaldetectorimportUniversalDetector
475472
buffers= []
476473
detector=UniversalDetector()
477474
whilenotdetector.done:

‎html5lib/tests/test_encoding.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,9 @@ def test_encoding():
5757

5858
# pylint:disable=wrong-import-position
5959
try:
60-
try:
61-
importcharade# noqa
62-
exceptImportError:
63-
importchardet# noqa
60+
importchardet# noqa
6461
exceptImportError:
65-
print("charade/chardet not found, skipping chardet tests")
62+
print("chardet not found, skipping chardet tests")
6663
else:
6764
deftest_chardet():
6865
withopen(os.path.join(test_dir,"encoding","chardet","test_big5.txt"),"rb")asfp:

‎requirements-optional.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# streams.
55
genshi
66

7-
#charade can be used as a fallback in case we are unable to determine
7+
#chardet can be used as a fallback in case we are unable to determine
88
# the encoding of a document.
9-
charade
9+
chardet>=2.2
1010

1111
# lxml is supported with its own treebuilder ("lxml") and otherwise
1212
# uses the standard ElementTree support

‎setup.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
importast
2-
importos
32
importcodecs
43

5-
fromsetuptoolsimportsetup
4+
fromos.pathimportjoin,dirname
5+
fromsetuptoolsimportsetup,find_packages
66

77

88
classifiers= [
@@ -22,18 +22,13 @@
2222
'Topic :: Text Processing :: Markup :: HTML'
2323
]
2424

25-
packages= ['html5lib']+ ['html5lib.'+name
26-
fornameinos.listdir(os.path.join('html5lib'))
27-
ifos.path.isdir(os.path.join('html5lib',name))and
28-
notname.startswith('.')andname!='tests']
29-
30-
current_dir=os.path.dirname(__file__)
31-
withcodecs.open(os.path.join(current_dir,'README.rst'),'r','utf8')asreadme_file:
32-
withcodecs.open(os.path.join(current_dir,'CHANGES.rst'),'r','utf8')aschanges_file:
25+
here=dirname(__file__)
26+
withcodecs.open(join(here,'README.rst'),'r','utf8')asreadme_file:
27+
withcodecs.open(join(here,'CHANGES.rst'),'r','utf8')aschanges_file:
3328
long_description=readme_file.read()+'\n'+changes_file.read()
3429

3530
version=None
36-
withopen(os.path.join("html5lib","__init__.py"),"rb")asinit_file:
31+
withopen(join("html5lib","__init__.py"),"rb")asinit_file:
3732
t=ast.parse(init_file.read(),filename="__init__.py",mode="exec")
3833
assertisinstance(t,ast.Module)
3934
assignments=filter(lambdax:isinstance(x,ast.Assign),t.body)
@@ -53,7 +48,7 @@
5348
classifiers=classifiers,
5449
maintainer='James Graham',
5550
maintainer_email='james@hoppipolla.co.uk',
56-
packages=packages,
51+
packages=find_packages(exclude=["*.tests","*.tests.*","tests.*","tests"]),
5752
install_requires=[
5853
'six',
5954
'webencodings',
@@ -70,13 +65,13 @@
7065

7166
# Standard extras, will be installed when the extra is requested.
7267
"genshi": ["genshi"],
73-
"charade": ["charade"],
68+
"chardet": ["chardet>=2.2"],
7469

7570
# The all extra combines a standard extra which will be used anytime
7671
# the all extra is requested, and it extends it with a conditional
7772
# extra that will be installed whenever the condition matches and the
7873
# all extra is requested.
79-
"all": ["genshi","charade"],
74+
"all": ["genshi","chardet>=2.2"],
8075
"all:platform.python_implementation == 'CPython'": ["datrie","lxml"],
8176
},
8277
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp