Responses

Response

class upyun.response.ResponseBase(response, url)

A response of successfully uploading image, contains extra info of the uploaded image

Parameters:
_get_header_with_prefix(name)
_populate_error()
error = None

Error of the request, a tuple in the form of (<status code>, <error message>)

response = None

Raw requests.Response from UpYun

success

Whether the API request is successful

url = None

URL of the file on the UpYun

class upyun.response.Response(response, url)

Bases: upyun.response.ResponseBase

class upyun.response.PutImageResponse(response, url)

Bases: upyun.response.ResponseBase, upyun.response.ImageInfoMixin, upyun.response.FileTypeMixin

class upyun.response.InfoResponse(response, url)

Bases: upyun.response.ResponseBase, upyun.response.FileInfoMixin, upyun.response.FileTypeMixin

class upyun.response.UsageResponse(response, url)

Bases: upyun.response.ResponseBase, upyun.response.UsageMixin

class upyun.response.GetResponse(response, url)

Bases: upyun.response.ResponseBase, upyun.response.GetMixin

class upyun.response.LsResponse(response, url)

Bases: upyun.response.ResponseBase, upyun.response.LsMixin

Mixin

class upyun.response.ImageInfoMixin
frames

Frames of the image

Return type:int or None
height

Height of the image

Return type:int or None
width

Width of the image

Return type:int or None
class upyun.response.FileInfoMixin
date

File created date

Return type:datetime.datetime or None
size

File size

Return type:int or None
class upyun.response.UsageMixin
usage

Usage of the space in bytes

Return type:int or None
class upyun.response.FileTypeMixin
type

File type of the queried path

FILE_TYPE_FILE or FILE_TYPE_FOLDER

class upyun.response.GetMixin
data

Data of the downloaded file

class upyun.response.LsMixin
files

Files in the directory

Key is the file name, value is FileInfo

Return type:dict
folders

Folders in the directory

Key is the folder name, value is FileInfo

Return type:dict
stuffs

All the stuffs in the directory

Key is file or folder name, value is FileInfo

Return type:dict
class upyun.response.LsMixin.FileInfo

A namedtuple reprenting the file info

Fields:

name
File name
path
File path
url
File URL
type
FILE_TYPE_FILE or FILE_TYPE_FOLDER
size
File size
mtimt
Last modified time
Read the Docs v: latest
Versions
latest
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.