From: Ben Darnell Date: Sat, 16 Mar 2013 05:21:53 +0000 (-0400) Subject: Fix most of the rest of the dangling references. X-Git-Tag: v3.0.0~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f3dec0c303cfb683776d8c3c7b9d8a7dd9acf8d;p=thirdparty%2Ftornado.git Fix most of the rest of the dangling references. --- diff --git a/docs/tcpserver.rst b/docs/tcpserver.rst index 3456cc903..5500ab4c5 100644 --- a/docs/tcpserver.rst +++ b/docs/tcpserver.rst @@ -1,5 +1,5 @@ -``tornado.tcpserver`` --- Basic `IOStream`-based TCP server -=========================================================== +``tornado.tcpserver`` --- Basic `.IOStream`-based TCP server +============================================================ .. automodule:: tornado.tcpserver :members: diff --git a/docs/twisted.rst b/docs/twisted.rst index 2e5222dfb..d7e2cd84e 100644 --- a/docs/twisted.rst +++ b/docs/twisted.rst @@ -10,32 +10,32 @@ depending on which library's underlying event loop you want to use. Twisted on Tornado ------------------ -`TornadoReactor` implements the Twisted reactor interface on top of -the Tornado IOLoop. To use it, simply call `install` at the beginning +``TornadoReactor`` implements the Twisted reactor interface on top of +the Tornado IOLoop. To use it, simply call ``install`` at the beginning of the application:: import tornado.platform.twisted tornado.platform.twisted.install() from twisted.internet import reactor -When the app is ready to start, call `IOLoop.instance().start()` -instead of `reactor.run()`. +When the app is ready to start, call ``IOLoop.instance().start()`` +instead of ``reactor.run()``. It is also possible to create a non-global reactor by calling -`tornado.platform.twisted.TornadoReactor(io_loop)`. However, if -the `IOLoop` and reactor are to be short-lived (such as those used in +``tornado.platform.twisted.TornadoReactor(io_loop)``. However, if +the `.IOLoop` and reactor are to be short-lived (such as those used in unit tests), additional cleanup may be required. Specifically, it is recommended to call:: reactor.fireSystemEvent('shutdown') reactor.disconnectAll() -before closing the `IOLoop`. +before closing the `.IOLoop`. Tornado on Twisted ------------------ -`TwistedIOLoop` implements the Tornado IOLoop interface on top of the Twisted +``TwistedIOLoop`` implements the Tornado IOLoop interface on top of the Twisted reactor. Recommended usage:: from tornado.platform.twisted import TwistedIOLoop @@ -44,6 +44,6 @@ reactor. Recommended usage:: # Set up your tornado application as usual using `IOLoop.instance` reactor.run() -`TwistedIOLoop` always uses the global Twisted reactor. +``TwistedIOLoop`` always uses the global Twisted reactor. This module has been tested with Twisted versions 11.0.0 and newer. diff --git a/docs/web.rst b/docs/web.rst index 4fba98695..041152c23 100644 --- a/docs/web.rst +++ b/docs/web.rst @@ -138,7 +138,7 @@ Authentication and security settings: * ``cookie_secret``: Used by `RequestHandler.get_secure_cookie` - and `set_secure_cookie` to sign cookies. + and `.set_secure_cookie` to sign cookies. * ``login_url``: The `authenticated` decorator will redirect to this url if the user is not logged in. Can be further customized by overriding `RequestHandler.get_login_url` diff --git a/tornado/httpclient.py b/tornado/httpclient.py index b5a4debc9..a9fda709c 100644 --- a/tornado/httpclient.py +++ b/tornado/httpclient.py @@ -1,30 +1,30 @@ """Blocking and non-blocking HTTP client interfaces. This module defines a common interface shared by two implementations, -`simple_httpclient` and `curl_httpclient`. Applications may either +``simple_httpclient`` and ``curl_httpclient``. Applications may either instantiate their chosen implementation class directly or use the `AsyncHTTPClient` class from this module, which selects an implementation that can be overridden with the `AsyncHTTPClient.configure` method. -The default implementation is `simple_httpclient`, and this is expected +The default implementation is ``simple_httpclient``, and this is expected to be suitable for most users' needs. However, some applications may wish -to switch to `curl_httpclient` for reasons such as the following: +to switch to ``curl_httpclient`` for reasons such as the following: -* `curl_httpclient` has some features not found in `simple_httpclient`, +* ``curl_httpclient`` has some features not found in ``simple_httpclient``, including support for HTTP proxies and the ability to use a specified network interface. -* `curl_httpclient` is more likely to be compatible with sites that are +* ``curl_httpclient`` is more likely to be compatible with sites that are not-quite-compliant with the HTTP spec, or sites that use little-exercised features of HTTP. -* `simple_httpclient` only supports SSL on Python 2.6 and above. +* ``simple_httpclient`` only supports SSL on Python 2.6 and above. -* `curl_httpclient` is faster +* ``curl_httpclient`` is faster -* `curl_httpclient` was the default prior to Tornado 2.0. +* ``curl_httpclient`` was the default prior to Tornado 2.0. -Note that if you are using `curl_httpclient`, it is highly recommended that +Note that if you are using ``curl_httpclient``, it is highly recommended that you use a recent version of ``libcurl`` and ``pycurl``. Currently the minimum supported version is 7.18.2, and the recommended version is 7.21.1 or newer. """ @@ -255,7 +255,7 @@ class HTTPRequest(object): client_key=None, client_cert=None): r"""Creates an `HTTPRequest`. - All parameters except `url` are optional. + All parameters except ``url`` are optional. :arg string url: URL to fetch :arg string method: HTTP method, e.g. "GET" or "POST" @@ -269,43 +269,43 @@ class HTTPRequest(object): header :arg bool follow_redirects: Should redirects be followed automatically or return the 3xx response? - :arg int max_redirects: Limit for `follow_redirects` + :arg int max_redirects: Limit for ``follow_redirects`` :arg string user_agent: String to send as ``User-Agent`` header :arg bool use_gzip: Request gzip encoding from the server :arg string network_interface: Network interface to use for request - :arg callable streaming_callback: If set, `streaming_callback` will + :arg callable streaming_callback: If set, ``streaming_callback`` will be run with each chunk of data as it is received, and - `~HTTPResponse.body` and `~HTTPResponse.buffer` will be empty in + ``HTTPResponse.body`` and ``HTTPResponse.buffer`` will be empty in the final response. - :arg callable header_callback: If set, `header_callback` will + :arg callable header_callback: If set, ``header_callback`` will be run with each header line as it is received (including the first line, e.g. ``HTTP/1.0 200 OK\r\n``, and a final line containing only ``\r\n``. All lines include the trailing newline - characters). `~HTTPResponse.headers` will be empty in the final + characters). ``HTTPResponse.headers`` will be empty in the final response. This is most useful in conjunction with - `streaming_callback`, because it's the only way to get access to + ``streaming_callback``, because it's the only way to get access to header data while the request is in progress. :arg callable prepare_curl_callback: If set, will be called with - a `pycurl.Curl` object to allow the application to make additional - `setopt` calls. + a ``pycurl.Curl`` object to allow the application to make additional + ``setopt`` calls. :arg string proxy_host: HTTP proxy hostname. To use proxies, - `proxy_host` and `proxy_port` must be set; `proxy_username` and - `proxy_pass` are optional. Proxies are currently only support - with `curl_httpclient`. + ``proxy_host`` and ``proxy_port`` must be set; ``proxy_username`` and + ``proxy_pass`` are optional. Proxies are currently only supported + with ``curl_httpclient``. :arg int proxy_port: HTTP proxy port :arg string proxy_username: HTTP proxy username :arg string proxy_password: HTTP proxy password - :arg bool allow_nonstandard_methods: Allow unknown values for `method` + :arg bool allow_nonstandard_methods: Allow unknown values for ``method`` argument? :arg bool validate_cert: For HTTPS requests, validate the server's certificate? :arg string ca_certs: filename of CA certificates in PEM format, - or None to use defaults. Note that in `curl_httpclient`, if - any request uses a custom `ca_certs` file, they all must (they - don't have to all use the same `ca_certs`, but it's not possible + or None to use defaults. Note that in ``curl_httpclient``, if + any request uses a custom ``ca_certs`` file, they all must (they + don't have to all use the same ``ca_certs``, but it's not possible to mix requests with ca_certs and requests that use the defaults. :arg bool allow_ipv6: Use IPv6 when available? Default is false in - `simple_httpclient` and true in `curl_httpclient` + ``simple_httpclient`` and true in ``curl_httpclient`` :arg string client_key: Filename for client SSL key, if any :arg string client_cert: Filename for client SSL certificate, if any """ diff --git a/tornado/httpserver.py b/tornado/httpserver.py index c52adbf8d..1ee4c9854 100644 --- a/tornado/httpserver.py +++ b/tornado/httpserver.py @@ -124,9 +124,9 @@ class HTTPServer(TCPServer): server.start(0) # Forks multiple sub-processes IOLoop.instance().start() - When using this interface, an `IOLoop` must *not* be passed - to the `HTTPServer` constructor. `start` will always start - the server on the default singleton `IOLoop`. + When using this interface, an `.IOLoop` must *not* be passed + to the `HTTPServer` constructor. `~.TCPServer.start` will always start + the server on the default singleton `.IOLoop`. 3. `~tornado.tcpserver.TCPServer.add_sockets`: advanced multi-process:: @@ -136,12 +136,12 @@ class HTTPServer(TCPServer): server.add_sockets(sockets) IOLoop.instance().start() - The `add_sockets` interface is more complicated, but it can be - used with `tornado.process.fork_processes` to give you more - flexibility in when the fork happens. `add_sockets` can - also be used in single-process servers if you want to create - your listening sockets in some way other than - `tornado.netutil.bind_sockets`. + The `~.TCPServer.add_sockets` interface is more complicated, + but it can be used with `tornado.process.fork_processes` to + give you more flexibility in when the fork happens. + `~.TCPServer.add_sockets` can also be used in single-process + servers if you want to create your listening sockets in some + way other than `tornado.netutil.bind_sockets`. """ def __init__(self, request_callback, no_keep_alive=False, io_loop=None, @@ -193,8 +193,10 @@ class HTTPConnection(object): def set_close_callback(self, callback): """Sets a callback that will be run when the connection is closed. - Use this instead of accessing `HTTPConnection.stream.set_close_callback` - directly (which was the recommended approach prior to Tornado 3.0). + Use this instead of accessing + `HTTPConnection.stream.set_close_callback + <.BaseIOStream.set_close_callback>` directly (which was the + recommended approach prior to Tornado 3.0). """ self._close_callback = stack_context.wrap(callback) self.stream.set_close_callback(self._on_connection_close) @@ -345,7 +347,7 @@ class HTTPRequest(object): .. attribute:: headers - `HTTPHeader` dictionary-like object for request headers. Acts like + `.HTTPHeaders` dictionary-like object for request headers. Acts like a case-insensitive dictionary with additional methods for repeated headers. @@ -355,13 +357,13 @@ class HTTPRequest(object): .. attribute:: remote_ip - Client's IP address as a string. If `HTTPServer.xheaders` is set, + Client's IP address as a string. If ``HTTPServer.xheaders`` is set, will pass along the real IP address provided by a load balancer in the ``X-Real-Ip`` header .. attribute:: protocol - The protocol used, either "http" or "https". If `HTTPServer.xheaders` + The protocol used, either "http" or "https". If ``HTTPServer.xheaders`` is set, will pass along the protocol used by a load balancer if reported via an ``X-Scheme`` header. @@ -375,13 +377,13 @@ class HTTPRequest(object): maps arguments names to lists of values (to support multiple values for individual names). Names are of type `str`, while arguments are byte strings. Note that this is different from - `RequestHandler.get_argument`, which returns argument values as + `.RequestHandler.get_argument`, which returns argument values as unicode strings. .. attribute:: files File uploads are available in the files property, which maps file - names to lists of :class:`HTTPFile`. + names to lists of `.HTTPFile`. .. attribute:: connection diff --git a/tornado/httputil.py b/tornado/httputil.py index 9a614a456..3fd709b81 100644 --- a/tornado/httputil.py +++ b/tornado/httputil.py @@ -297,8 +297,8 @@ def parse_multipart_form_data(boundary, data, arguments, files): def format_timestamp(ts): """Formats a timestamp in the format used by HTTP. - The argument may be a numeric timestamp as returned by `time.time()`, - a time tuple as returned by `time.gmtime()`, or a `datetime.datetime` + The argument may be a numeric timestamp as returned by `time.time`, + a time tuple as returned by `time.gmtime`, or a `datetime.datetime` object. >>> format_timestamp(1359312200) diff --git a/tornado/ioloop.py b/tornado/ioloop.py index e63ac631c..1b3727c97 100644 --- a/tornado/ioloop.py +++ b/tornado/ioloop.py @@ -308,16 +308,17 @@ class IOLoop(Configurable): def run_sync(self, func, timeout=None): """Starts the `IOLoop`, runs the given function, and stops the loop. - If the function returns a `Future`, the `IOLoop` will run until - the future is resolved. If it raises an exception, the `IOLoop` - will stop and the exception will be re-raised to the caller. + If the function returns a `~concurrent.futures.Future`, the + `IOLoop` will run until the future is resolved. If it raises + an exception, the `IOLoop` will stop and the exception will be + re-raised to the caller. The keyword-only argument ``timeout`` may be used to set a maximum duration for the function. If the timeout expires, a `TimeoutError` is raised. This method is useful in conjunction with `tornado.gen.coroutine` - to allow asynchronous calls in a `main()` function:: + to allow asynchronous calls in a ``main()`` function:: @gen.coroutine def main(): diff --git a/tornado/iostream.py b/tornado/iostream.py index bcb0eb46e..476a37874 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -58,7 +58,7 @@ class BaseIOStream(object): All of the methods take callbacks (since writing and reading are non-blocking and asynchronous). - When a stream is closed due to an error, the IOStream's `error` + When a stream is closed due to an error, the IOStream's ``error`` attribute contains the exception object. Subclasses must implement `fileno`, `close_fd`, `write_to_fd`, @@ -213,7 +213,7 @@ class BaseIOStream(object): """Close this stream. If ``exc_info`` is true, set the ``error`` attribute to the current - exception from `sys.exc_info()` (or if ``exc_info`` is a tuple, + exception from `sys.exc_info` (or if ``exc_info`` is a tuple, use that instead of `sys.exc_info`). """ if not self.closed(): diff --git a/tornado/netutil.py b/tornado/netutil.py index cbf0f8004..fe2b38066 100644 --- a/tornado/netutil.py +++ b/tornado/netutil.py @@ -162,9 +162,9 @@ def is_valid_ip(ip): class Resolver(Configurable): """Configurable asynchronous DNS resolver interface. - By default, a blocking implementation is used (which simply - calls `socket.getaddrinfo`). An alternative implementation - can be chosen with the `Resolver.configure` class method:: + By default, a blocking implementation is used (which simply calls + `socket.getaddrinfo`). An alternative implementation can be + chosen with the ``Resolver.configure`` class method:: Resolver.configure('tornado.netutil.ThreadedResolver') @@ -173,8 +173,8 @@ class Resolver(Configurable): * `tornado.netutil.BlockingResolver` * `tornado.netutil.ThreadedResolver` * `tornado.netutil.OverrideResolver` - * `tornado.platform.twisted.TwistedResolver` - * `tornado.platform.caresresolver.CaresResolver` + * ``tornado.platform.twisted.TwistedResolver`` + * ``tornado.platform.caresresolver.CaresResolver`` """ @classmethod def configurable_base(cls): @@ -190,12 +190,12 @@ class Resolver(Configurable): The ``host`` argument is a string which may be a hostname or a literal IP address. - Returns a `Future` whose result is a list of (family, address) - pairs, where address is a tuple suitable to pass to - `socket.connect` (i.e. a (host, port) pair for IPv4; - additional fields may be present for IPv6). If a callback is - passed, it will be run with the result as an argument when - it is complete. + Returns a `~concurrent.futures.Future` whose result is a list + of (family, address) pairs, where address is a tuple suitable + to pass to `socket.socket.connect` (i.e. a (host, port) pair for + IPv4; additional fields may be present for IPv6). If a + callback is passed, it will be run with the result as an + argument when it is complete. """ raise NotImplementedError() @@ -217,8 +217,8 @@ class ExecutorResolver(Resolver): class BlockingResolver(ExecutorResolver): """Default `Resolver` implementation, using `socket.getaddrinfo`. - The `IOLoop` will be blocked during the resolution, although the - callback will not be run until the next `IOLoop` iteration. + The `.IOLoop` will be blocked during the resolution, although the + callback will not be run until the next `.IOLoop` iteration. """ def initialize(self, io_loop=None): super(BlockingResolver, self).initialize(io_loop=io_loop) @@ -273,10 +273,10 @@ def ssl_options_to_context(ssl_options): """Try to Convert an ssl_options dictionary to an SSLContext object. The ``ssl_options`` dictionary contains keywords to be passed to - `ssl.wrap_sockets`. In Python 3.2+, `ssl.SSLContext` objects can + `ssl.wrap_socket`. In Python 3.2+, `ssl.SSLContext` objects can be used instead. This function converts the dict form to its - `SSLContext` equivalent, and may be used when a component which - accepts both forms needs to upgrade to the `SSLContext` version + `~ssl.SSLContext` equivalent, and may be used when a component which + accepts both forms needs to upgrade to the `~ssl.SSLContext` version to use features like SNI or NPN. """ if isinstance(ssl_options, dict): @@ -298,12 +298,12 @@ def ssl_options_to_context(ssl_options): def ssl_wrap_socket(socket, ssl_options, server_hostname=None, **kwargs): - """Returns an `ssl.SSLSocket` wrapping the given socket. + """Returns an ``ssl.SSLSocket`` wrapping the given socket. ``ssl_options`` may be either a dictionary (as accepted by - `ssl_options_to_context) or an `ssl.SSLContext` object. - Additional keyword arguments are passed to `wrap_socket` - (either the `SSLContext` method or the `ssl` module function + `ssl_options_to_context`) or an `ssl.SSLContext` object. + Additional keyword arguments are passed to ``wrap_socket`` + (either the `~ssl.SSLContext` method or the `ssl` module function as appropriate). """ context = ssl_options_to_context(ssl_options) diff --git a/tornado/options.py b/tornado/options.py index ee146fca0..1995938f8 100644 --- a/tornado/options.py +++ b/tornado/options.py @@ -258,15 +258,16 @@ class OptionParser(object): callback() def mockable(self): - """Returns a wrapper around self that is compatible with `mock.patch`. - - The `mock.patch` function (included in the standard library - `unittest.mock` package since Python 3.3, or in the - third-party `mock` package for older versions of Python) is - incompatible with objects like ``options`` that override - ``__getattr__`` and ``__setattr__``. This function returns an - object that can be used with `mock.patch.object` to modify - option values:: + """Returns a wrapper around self that is compatible with + `mock.patch `. + + The `mock.patch ` function (included in + the standard library `unittest.mock` package since Python 3.3, + or in the third-party ``mock`` package for older versions of + Python) is incompatible with objects like ``options`` that + override ``__getattr__`` and ``__setattr__``. This function + returns an object that can be used with `mock.patch.object + ` to modify option values:: with mock.patch.object(options.mockable(), 'name', value): assert options.name == value diff --git a/tornado/process.py b/tornado/process.py index 55481a22c..5ebe829d9 100644 --- a/tornado/process.py +++ b/tornado/process.py @@ -169,8 +169,8 @@ class Subprocess(object): additions: * ``stdin``, ``stdout``, and ``stderr`` may have the value - `tornado.process.Subprocess.STREAM`, which will make the corresponding - attribute of the resulting Subprocess a `PipeIOStream`. + ``tornado.process.Subprocess.STREAM``, which will make the corresponding + attribute of the resulting Subprocess a `.PipeIOStream`. * A new keyword argument ``io_loop`` may be used to pass in an IOLoop. """ STREAM = object() diff --git a/tornado/stack_context.py b/tornado/stack_context.py index c30a2598f..ee1a9a2b7 100644 --- a/tornado/stack_context.py +++ b/tornado/stack_context.py @@ -52,7 +52,7 @@ Here are a few rules of thumb for when it's necessary: * If you're writing an asynchronous library that doesn't rely on a stack_context-aware library like `tornado.ioloop` or `tornado.iostream` (for example, if you're writing a thread pool), use - `stack_context.wrap()` before any asynchronous operations to capture the + `.stack_context.wrap()` before any asynchronous operations to capture the stack context from where the operation was started. * If you're writing an asynchronous library that has some shared diff --git a/tornado/tcpserver.py b/tornado/tcpserver.py index e0c5f3b64..80bb09a94 100644 --- a/tornado/tcpserver.py +++ b/tornado/tcpserver.py @@ -60,9 +60,9 @@ class TCPServer(object): server.start(0) # Forks multiple sub-processes IOLoop.instance().start() - When using this interface, an `IOLoop` must *not* be passed + When using this interface, an `.IOLoop` must *not* be passed to the `TCPServer` constructor. `start` will always start - the server on the default singleton `IOLoop`. + the server on the default singleton `.IOLoop`. 3. `add_sockets`: advanced multi-process:: @@ -77,7 +77,7 @@ class TCPServer(object): flexibility in when the fork happens. `add_sockets` can also be used in single-process servers if you want to create your listening sockets in some way other than - `bind_sockets`. + `~tornado.netutil.bind_sockets`. """ def __init__(self, io_loop=None, ssl_options=None): self.io_loop = io_loop @@ -109,7 +109,7 @@ class TCPServer(object): This method may be called more than once to listen on multiple ports. `listen` takes effect immediately; it is not necessary to call `TCPServer.start` afterwards. It is, however, necessary to start - the `IOLoop`. + the `.IOLoop`. """ sockets = bind_sockets(port, address=address) self.add_sockets(sockets) @@ -118,7 +118,7 @@ class TCPServer(object): """Makes this server start accepting connections on the given sockets. The ``sockets`` parameter is a list of socket objects such as - those returned by `bind_sockets`. + those returned by `~tornado.netutil.bind_sockets`. `add_sockets` is typically used in combination with that method and `tornado.process.fork_processes` to provide greater control over the initialization of a multi-process server. @@ -150,7 +150,7 @@ class TCPServer(object): both will be used if available. The ``backlog`` argument has the same meaning as for - `socket.listen`. + `socket.socket.listen`. This method may be called multiple times prior to `start` to listen on multiple ports or interfaces. @@ -200,7 +200,7 @@ class TCPServer(object): sock.close() def handle_stream(self, stream, address): - """Override to handle a new `IOStream` from an incoming connection.""" + """Override to handle a new `.IOStream` from an incoming connection.""" raise NotImplementedError() def _handle_connection(self, connection, address): diff --git a/tornado/template.py b/tornado/template.py index 4f61de3f8..f91b4b139 100644 --- a/tornado/template.py +++ b/tornado/template.py @@ -79,9 +79,10 @@ We provide the functions escape(), url_escape(), json_encode(), and squeeze() to all templates by default. Typical applications do not create `Template` or `Loader` instances by -hand, but instead use the `render` and `render_string` methods of +hand, but instead use the `~.RequestHandler.render` and +`~.RequestHandler.render_string` methods of `tornado.web.RequestHandler`, which load templates automatically based -on the ``template_path`` `Application` setting. +on the ``template_path`` `.Application` setting. Syntax Reference ---------------- @@ -109,7 +110,7 @@ with ``{# ... #}``. ``{% autoescape *function* %}`` Sets the autoescape mode for the current file. This does not affect other files, even those referenced by ``{% include %}``. Note that - autoescaping can also be configured globally, at the `Application` + autoescaping can also be configured globally, at the `.Application` or `Loader`.:: {% autoescape xhtml_escape %} diff --git a/tornado/testing.py b/tornado/testing.py index 37b75ea93..455b68b94 100644 --- a/tornado/testing.py +++ b/tornado/testing.py @@ -366,7 +366,7 @@ class AsyncHTTPSTestCase(AsyncHTTPTestCase): def gen_test(f): """Testing equivalent of ``@gen.coroutine``, to be applied to test methods. - ``@gen.coroutine`` cannot be used on tests because the `IOLoop` is not + ``@gen.coroutine`` cannot be used on tests because the `.IOLoop` is not already running. ``@gen_test`` should be applied to test methods on subclasses of `AsyncTestCase`. diff --git a/tornado/web.py b/tornado/web.py index fa3089f15..e1f2ccbd8 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -167,7 +167,7 @@ class RequestHandler(object): @property def settings(self): - """An alias for `self.application.settings`.""" + """An alias for ``self.application.settings``.""" return self.application.settings def head(self, *args, **kwargs): @@ -253,10 +253,11 @@ class RequestHandler(object): def set_status(self, status_code, reason=None): """Sets the status code for our response. - :arg int status_code: Response status code. If `reason` is ``None``, - it must be present in `httplib.responses`. + :arg int status_code: Response status code. If ``reason`` is ``None``, + it must be present in `httplib.responses `. :arg string reason: Human-readable reason phrase describing the status - code. If ``None``, it will be filled in from `httplib.responses`. + code. If ``None``, it will be filled in from + `httplib.responses `. """ self._status_code = status_code if reason is not None: @@ -1456,7 +1457,7 @@ class Application(object): return handler def reverse_url(self, name, *args): - """Returns a URL path for handler named `name` + """Returns a URL path for handler named ``name`` The handler must be added to the application as a named URLSpec. @@ -1494,7 +1495,8 @@ class HTTPError(Exception): """An exception that will turn into an HTTP error response. :arg int status_code: HTTP status code. Must be listed in - `httplib.responses` unless the ``reason`` keyword argument is given. + `httplib.responses ` unless the ``reason`` + keyword argument is given. :arg string log_message: Message to be written to the log for this error (will not be shown to the user unless the `Application` is in debug mode). May contain ``%s``-style placeholders, which will be filled diff --git a/tornado/websocket.py b/tornado/websocket.py index cf1e6d1cf..b3184862f 100644 --- a/tornado/websocket.py +++ b/tornado/websocket.py @@ -795,7 +795,8 @@ class WebSocketClientConnection(simple_httpclient._HTTPConnection): def websocket_connect(url, io_loop=None, callback=None): """Client-side websocket support. - Takes a url and returns a Future whose result is a `WebSocketConnection`. + Takes a url and returns a Future whose result is a + `WebSocketClientConnection`. """ if io_loop is None: io_loop = IOLoop.current()