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

def nautilus_image_manipulator::upload::poster::encode::MultipartParam::from_file (   cls,
  paramname,
  filename 
)
Returns a new MultipartParam object constructed from the local
file at ``filename``.

``filesize`` is determined by os.path.getsize(``filename``)

``filetype`` is determined by mimetypes.guess_type(``filename``)[0]

``filename`` is set to os.path.basename(``filename``)

Definition at line 130 of file encode.py.

                                           :
        """Returns a new MultipartParam object constructed from the local
        file at ``filename``.

        ``filesize`` is determined by os.path.getsize(``filename``)

        ``filetype`` is determined by mimetypes.guess_type(``filename``)[0]

        ``filename`` is set to os.path.basename(``filename``)
        """

        return cls(paramname, filename=os.path.basename(filename),
                filetype=mimetypes.guess_type(filename)[0],
                filesize=os.path.getsize(filename),
                fileobj=open(filename, "rb"))


Generated by  Doxygen 1.6.0   Back to index