Skip to content

Commit

Permalink
Merge pull request #418 from KeepSafe/cchardet
Browse files Browse the repository at this point in the history
Support cchardet
  • Loading branch information
asvetlov committed Jun 22, 2015
2 parents 4bca7ab + 0b8d18d commit 3c16c1d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ CHANGES
Backward-compatibility warning: this may change the url matched by
your queries if they send quoted characted (like %2F for /) #414

- Use optional cchardet accelerator if present #418


0.16.5 (06-13-2015)
-------------------
Expand Down
5 changes: 4 additions & 1 deletion aiohttp/client_reqrep.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
import urllib.parse
import warnings

import chardet
try:
import cchardet as chardet
except ImportError:
import chardet

import aiohttp
from . import hdrs, helpers, streams
Expand Down
15 changes: 14 additions & 1 deletion docs/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,26 @@

Reference implementation of :pep:`3156`

See https://pypi.python.org/pypi/asyncio/
https://pypi.python.org/pypi/asyncio/

callable

Any object that can be called. Use :func:`callable` to check
that.

chardet

The Universal Character Encoding Detector

https://pypi.python.org/pypi/chardet/

cchardet

cChardet is high speed universal character encoding detector -
binding to charsetdetect.

https://pypi.python.org/pypi/cchardet/

web-handler

An endpoint that returns http response.
16 changes: 14 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ Library Installation

::

pip install aiohttp
$ pip install aiohttp

You may want to install *optional* :term:`cchardet` library as faster
replacement for :term:`chardet`::

$ pip install cchardet

Getting Started
---------------
Expand Down Expand Up @@ -99,6 +104,13 @@ Dependencies

- Python 3.3 and :term:`asyncio` or Python 3.4+
- *chardet* library
- *Optional* :term:`cchardet` library as faster replacement for
:term:`chardet`.

Install it manually via::

$ pip install cchardet


Contributing
------------
Expand All @@ -110,7 +122,7 @@ before making a Pull Request.
Authors and License
-------------------

The ``aiohttp`` package is written mainly by Nikolay Kim and Andrew Svetlov.
The ``aiohttp`` package is written mostly by Nikolay Kim and Andrew Svetlov.

It's *Apache 2* licensed and freely available.

Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[tox]

envlist = check, {old_asyncio,py33,py34}-{debug,release}-{cython,pure}, reportcov
envlist = check, {old_asyncio,py33,py34}-{debug,release}-{cchardet,cython,pure}, reportcov

[testenv]

deps =
nose
coverage
gunicorn
chardet
cchardet: cython
cchardet: cchardet
cython: cython
old_asyncio: asyncio==3.4.1

Expand Down

0 comments on commit 3c16c1d

Please sign in to comment.