Logo Search packages:      
Sourcecode: nautilus-image-manipulator version File versions  Download package

Public Member Functions | Public Attributes

nautilus_image_manipulator::upload::poster::encode::MultipartParam Class Reference

List of all members.

Public Member Functions

def __cmp__
def __init__
def encode
def encode_hdr
def from_file
def from_params
def get_size
def iter_encode
def reset

Public Attributes


Detailed Description

Represents a single parameter in a multipart/form-data request

``name`` is the name of this parameter.

If ``value`` is set, it must be a string or unicode object to use as the
data for this parameter.

If ``filename`` is set, it is what to say that this parameter's filename
is.  Note that this does not have to be the actual filename any local file.

If ``filetype`` is set, it is used as the Content-Type for this parameter.
If unset it defaults to "text/plain; charset=utf8"

If ``filesize`` is set, it specifies the length of the file ``fileobj``

If ``fileobj`` is set, it must be a file-like object that supports

Both ``value`` and ``fileobj`` must not be set, doing so will
raise a ValueError assertion.

If ``fileobj`` is set, and ``filesize`` is not specified, then
the file's size will be determined first by stat'ing ``fileobj``'s
file descriptor, and if that fails, by seeking to the end of the file,
recording the current position as the size, and then by seeking back to the
beginning of the file.

``cb`` is a callable which will be called from iter_encode with (self,
current, total), representing the current parameter, current amount
transferred, and the total size.

Definition at line 50 of file encode.py.

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index