Classes | Functions | Variables
tornado::util Namespace Reference

Classes

class  ArgReplacer
class  Configurable
class  GzipDecompressor
class  ObjectDict

Functions

def _websocket_mask_python
def doctests
def errno_from_exception
def import_object
def timedelta_to_seconds
def u

Variables

 _websocket_mask = _websocket_mask_python
 basestring_type = str
 bytes_type = bytes
 unicode_type = str
 xrange = range

Detailed Description

Miscellaneous utility functions and classes.

This module is used internally by Tornado.  It is not necessarily expected
that the functions and classes defined here will be useful to other
applications, but they are documented here in case they are.

The one public-facing part of this module is the `Configurable` class
and its `~Configurable.configure` method, which becomes a part of the
interface of its subclasses, including `.AsyncHTTPClient`, `.IOLoop`,
and `.Resolver`.

Function Documentation

def tornado.util._websocket_mask_python (   mask,
  data 
) [private]
Websocket masking function.

`mask` is a `bytes` object of length 4; `data` is a `bytes` object of any length.
Returns a `bytes` object of the same length as `data` with the mask applied
as specified in section 5.3 of RFC 6455.

This pure-python implementation may be replaced by an optimized version when available.

Definition at line 319 of file util.py.

Definition at line 354 of file util.py.

Provides the errno from an Exception object.

There are cases that the errno attribute was not set so we pull
the errno out of the args but if someone instatiates an Exception
without any args you will get a tuple error. So this function
abstracts all that behavior to give you a safe way to get the
errno.

Definition at line 153 of file util.py.

Imports an object by name.

import_object('x') is equivalent to 'import x'.
import_object('x.y.z') is equivalent to 'from x.y import z'.

>>> import tornado.escape
>>> import_object('tornado.escape') is tornado.escape
True
>>> import_object('tornado.escape.utf8') is tornado.escape.utf8
True
>>> import_object('tornado') is tornado
True
>>> import_object('tornado.missing_module')
Traceback (most recent call last):
    ...
ImportError: No module named missing_module

Definition at line 81 of file util.py.

Equivalent to td.total_seconds() (introduced in python 2.7).

Definition at line 314 of file util.py.

def tornado::util::u (   s)

Definition at line 116 of file util.py.


Variable Documentation

Definition at line 344 of file util.py.

Definition at line 120 of file util.py.

Definition at line 118 of file util.py.

Definition at line 119 of file util.py.

Definition at line 25 of file util.py.



rosbridge_server
Author(s): Jonathan Mace
autogenerated on Thu Jun 6 2019 21:51:51