Skip to content
This repository was archived by the owner on May 31, 2021. It is now read-only.

Commit c43065c

Browse files
authored
Merge pull request #32 from asyncio-docs/Mariatta-patch-1
Create .travis.yml
2 parents bf416f2 + 59291dd commit c43065c

File tree

6 files changed

+40
-8
lines changed

6 files changed

+40
-8
lines changed

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
language: python
2+
python: 3.6
3+
cache: pip
4+
5+
install: python3 -m pip install -U pip -r requirements.txt
6+
7+
script:
8+
- sphinx-build -n -W -q -b html -d _build/doctrees . _build/html

conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
# Add any paths that contain custom static files (such as style sheets) here,
179179
# relative to this directory. They are copied after the builtin static files,
180180
# so a file named "default.css" will overwrite the builtin "default.css".
181-
html_static_path = ['_static']
181+
html_static_path = ['_build/html/_static']
182182

183183
# Add any extra paths that contain custom files (such as robots.txt or
184184
# .htaccess) here, relative to this directory. These files are copied

getting_started.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,34 @@ All platforms with ``conda``
2323
* Create a new Python 3.5 environment (named ``aio35``, use a different
2424
if you like)::
2525

26+
.. highlight:: bash
27+
2628
conda create -n aio35 python=3.5
2729

2830
* Activate it.
2931
Linux and OS X::
3032

33+
.. highlight:: bash
34+
3135
$ source activate aio35
3236

3337
Windows::
3438

39+
.. highlight:: bash
40+
3541
$ source activate aio35
3642

3743
* Install ``aiohttp``::
3844

45+
.. highlight:: bash
46+
3947
$(aio35) pip install aiohttp
4048

4149
Platform specific
4250
-----------------
4351

4452
.. would be good to have some word about installing on Windows
53+
4554
* Windows: The easiest way to use Python 3.5 would be to use a package manager
4655
such as conda. See the installation instructions above.
4756
* Mac OS X: Install `Homebrew </usr/bin/ruby -e "$(curl -fsSL

glossary.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ Glossary
2121

2222
future
2323
It's like a mailbox where you can subscribe to receive a result when it
24-
will be done. More details in `official documentation
24+
will be done. More details in `official future documentation
2525
<https://docs.python.org/3/library/asyncio-task.html#future>`_
2626

2727
task
2828
It represents the execution of a coroutine and take care the result in a
29-
future. More details in `official documentation
29+
future. More details in `official task documentation
3030
<https://docs.python.org/3/library/asyncio-task.html#task>`_
31+

hello_world.rst

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ This is a series of examples showing the basics of how to write
99
Simple coroutine
1010
----------------
1111

12-
This example uses the :py:meth:`asyncio.BaseEventLoop.run_until_complete`
12+
This example uses the :py:meth:`asyncio.AbstractEventLoop.run_until_complete`
1313
method to schedule a simple function that will wait one second, print
1414
``hello`` and then finish.
1515

16-
Because it is launched with :py:meth:`run_until_complete`,
16+
Because it is launched with :py:meth:`asyncio.AbstractEventLoop.run_until_complete`,
1717
the :term:`event loop <event loop>` itself
1818
will terminate once the :term:`coroutine <coroutine>` is completed.
1919

@@ -49,7 +49,9 @@ all scheduled :term:`tasks <task>` could execute, which results in a warning.
4949

5050
Warning::
5151

52-
Task was destroyed but it is pending!
53-
task: <Task pending coro=<say() done, defined at examples/loop_stop.py:3>
54-
wait_for=<Future pending cb=[Task._wakeup()]>>
52+
.. highlight:: none
53+
54+
Task was destroyed but it is pending!
55+
task: <Task pending coro=<say() done, defined at examples/loop_stop.py:3>
56+
wait_for=<Future pending cb=[Task._wakeup()]>>
5557

webscraper.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ This is a very simple web server. (See below for the code.)
2121
Its only purpose is to wait for a given amount of time.
2222
Test it by running it from the command line::
2323

24+
.. highlight:: bash
25+
2426
$ python simple_server.py
2527

2628
It will answer like this::
@@ -125,6 +127,8 @@ difference provides the elapsed run time.
125127

126128
Finally, we can run our client::
127129

130+
.. highlight:: bash
131+
128132
$ python synchronous_client.py
129133

130134
and get this output::
@@ -254,6 +258,8 @@ This means, we wait until each pages has been retrieved before asking for
254258
the next.
255259
Let's run it from the command-line to see what happens::
256260

261+
.. highlight:: bash
262+
257263
$ async_client_blocking.py
258264
It took 11.06 seconds for a total waiting time of 11.00.
259265
Waited for 1.00 seconds.
@@ -320,6 +326,8 @@ So, for a list with 100 tasks it would mean:
320326
321327
Let's see if we got any faster::
322328

329+
.. highlight:: bash
330+
323331
$ async_client_nonblocking.py
324332
It took 5.08 seconds for a total waiting time of 11.00.
325333
Waited for 1.00 seconds.
@@ -359,6 +367,8 @@ The library aiohttp_ allows to write HTTP client and server applications,
359367
using a high-level approach.
360368
Install with::
361369

370+
.. highlight:: bash
371+
362372
$ pip install aiohttp
363373

364374

@@ -409,6 +419,8 @@ to ``fetch_page()`` as the first argument.
409419

410420
Finally, we run this program::
411421

422+
.. highlight:: bash
423+
412424
$ python aiohttp_client.py
413425
It took 5.04 seconds for a total waiting time of 11.00.
414426
Waited for 1.00 seconds.

0 commit comments

Comments
 (0)