Module Expr Str Import alias Import alias Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore ListLoad Str Str Str Str Str Assign NameStore Str Assign NameStore Call NameLoad ListLoad Str Assign NameStore Str Assign NameStore BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore Str ClassDef bases NameLoad body Expr Str decorator_list If UnaryOpNot Call NameLoad NameLoad Str body ClassDef bases NameLoad body Expr Str decorator_list orelse ClassDef bases AttributeLoad NameLoad attr body Expr Str decorator_list ClassDef bases NameLoad body Expr Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad AttributeLoad NameLoad attr Str body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad ListLoad TupleLoad NameLoad NameLoad orelse If CompareIsNot NameLoad NameLoad body AugAssignAdd NameStore Num Return Call NameLoad Call AttributeLoad NameLoad attr ListLoad TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot Call NameLoad AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIs NameLoad NameLoad body Return NameLoad Assign NameStore ListLoad For TupleStore NameStore NameStore SubscriptLoad NameLoad Index Num body If CompareIsNot NameLoad NameLoad body AugAssignSub NameStore Num Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Return TupleLoad SubscriptLoad NameLoad Index Num NameLoad orelse Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr TryFinally body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad finalbody Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str If BoolOpAnd CompareIsNot NameLoad NameLoad CompareIs NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore CompareIsNot NameLoad NameLoad If NameLoad body If CompareIsNot NameLoad NameLoad body If CompareGt NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call NameLoad NameLoad NameLoad If BoolOpAnd NameLoad NameLoad NameLoad body If CompareNotEq NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad If BoolOpAnd NameLoad CompareIsNot NameLoad NameLoad body Return NameLoad orelse If NameLoad body Return NameLoad orelse Return NameLoad decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str Assign NameStore Call NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad kwarg body Expr Str If BinOpSub Call NameLoad NameLoad NameLoad body Assign NameStore ListLoad For NameStore NameLoad body If CompareNotIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If CompareEq Call NameLoad NameLoad Num body Raise Call NameLoad BinOpMod Str SubscriptLoad NameLoad Index Num orelse Raise Call NameLoad BinOpMod Str Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Assign NameStore CompareIsNot NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str NameLoad If CompareIsNot NameLoad NameLoad body Assign SubscriptStore AttributeLoad AttributeLoad NameLoad attr attr Index AttributeLoad NameLoad attr NameLoad If Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore NameLoad orelse Assign NameStore NameLoad Assign NameStore NameLoad Assign SubscriptStore AttributeLoad AttributeLoad NameLoad attr attr Index AttributeLoad NameLoad attr Call NameLoad NameLoad If NameLoad body If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Assign SubscriptStore AttributeLoad AttributeLoad NameLoad attr attr Index Str NameLoad orelse Delete SubscriptDel AttributeLoad AttributeLoad NameLoad attr attr Index Str FunctionDef arguments args NameParam defaults body If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Assign SubscriptStore AttributeLoad AttributeLoad NameLoad attr attr Index Str BinOpMod NameLoad NameLoad decorator_list If NameLoad body If Call NameLoad NameLoad NameLoad body Expr Call NameLoad NameLoad orelse If BoolOpAnd NameLoad CompareIs NameLoad NameLoad body Expr Call NameLoad AttributeLoad NameLoad attr orelse If UnaryOpNot NameLoad body Raise Call NameLoad Str orelse Raise Call NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str NameLoad If CompareIs NameLoad NameLoad body Return NameLoad TryExcept body Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body Raise Call NameLoad BinOpMod Str NameLoad If CompareIs NameLoad NameLoad body Raise Call NameLoad BinOpMod Str NameLoad Assign TupleStore NameStore NameStore NameLoad If CompareNotEq Call NameLoad NameLoad Num body Raise Call NameLoad Str If CompareNotEq NameLoad NameLoad body Raise Call NameLoad Str NameLoad Return SubscriptLoad NameLoad Index Num decorator_list decorator_list ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults vararg kwarg body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr Dict For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body If Call NameLoad NameLoad AttributeLoad NameLoad attr body If CompareIn Str AttributeLoad NameLoad attr body Expr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad ListLoad attr Call AttributeLoad NameLoad attr NameLoad If NameLoad body TryExcept body Return Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad handlers ExceptHandler type NameLoad body Return ListLoad orelse Assign NameStore ListLoad For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body AugAssignAdd NameStore NameLoad Return NameLoad decorator_list decorator_list
N/A N/A Handler library for Blobstore API.

Contains handlers to help with uploading and downloading blobs.

Public Classes:
  BlobstoreDownloadHandler: Has helper method for easily sending blobs
    to client.
  BlobstoreUploadHandler: Handler for receiving upload notification requests.

Public Exceptions (indentation indications class hierarchy):
  Error: Base class for service handler errors.
    RangeFormatError: Raised when Range header has invalid format.
      UnsupportedRangeFormatError: Raised when range header has valid format
        but a particular feature or unit type is not supported.
 N/A cgi N/A cStringIO N/A os N/A re N/A sys google.appengine.ext blobstore google.appengine.ext webapp webob byterange N/A __all__ N/A Error RangeFormatError UnsupportedRangeFormatError BlobstoreDownloadHandler BlobstoreUploadHandler N/A _CONTENT_DISPOSITION_FORMAT attachment; filename="%s" N/A _SEND_BLOB_PARAMETERS N/A frozenset N/A use_range N/A _RANGE_NUMERIC_FORMAT ([0-9]*)-([0-9]*) N/A _RANGE_FORMAT N/A ([a-zA-Z]+)=%s _RANGE_NUMERIC_FORMAT N/A _RANGE_FORMAT_REGEX N/A N/A re compile N/A ^%s$ _RANGE_FORMAT N/A _UNSUPPORTED_RANGE_FORMAT_REGEX N/A N/A re compile N/A ^%s(?:,%s)+$ N/A _RANGE_FORMAT _RANGE_NUMERIC_FORMAT N/A _BYTES_UNIT bytes Error N/A Exception N/A N/A Base class for all errors in blobstore handlers module. N/A N/A N/A N/A hasattr webapp Error N/A RangeFormatError N/A Error N/A N/A Raised when Range header incorrectly formatted. N/A N/A RangeFormatError N/A N/A webapp Error N/A N/A Raised when Range header incorrectly formatted. N/A UnsupportedRangeFormatError N/A RangeFormatError N/A N/A Raised when Range format is correct, but not supported. N/A _serialize_range N/A N/A start end N/A N/A N/A Return a string suitable for use as a value in a RANGE header.

  Args:
    start: The start of the bytes range e.g. 50.
    end: The end of the bytes range e.g. 100. This value is inclusive and may
      be None if the end of the range is not specified.

  Returns:
    Returns a string (e.g. "bytes=50-100") that represents a serialized RANGE
    header value.
   N/A N/A hasattr N/A byterange Range serialize_bytes N/A N/A N/A N/A N/A byterange Range serialize_bytes _BYTES_UNIT N/A N/A start end N/A N/A N/A end None N/A N/A end 1 N/A N/A str N/A N/A byterange Range N/A N/A start end N/A _parse_bytes N/A N/A range_header N/A N/A N/A Returns a list of byte ranges given the value of a RANGE header. N/A N/A N/A hasattr N/A byterange Range serialize_bytes N/A N/A parse_result N/A N/A N/A byterange Range parse_bytes range_header N/A N/A parse_result None N/A N/A None N/A ranges N/A N/A N/A start end N/A parse_result N/A 1 N/A N/A N/A end None N/A N/A end 1 N/A N/A N/A ranges append N/A start end N/A N/A N/A parse_result N/A 0 ranges N/A N/A original_stdout N/A sys stdout N/A N/A sys stdout N/A N/A cStringIO StringIO N/A N/A N/A N/A N/A N/A byterange Range parse_bytes range_header N/A N/A N/A sys stdout original_stdout N/A _check_ranges N/A N/A start end use_range_set use_range range_header N/A N/A N/A Set the range header.

  Args:
    start: As passed in from send_blob.
    end: As passed in from send_blob.
    use_range_set: Use range was explcilty set during call to send_blob.
    use_range: As passed in from send blob.
    range_header: Range header as received in HTTP request.

  Returns:
    Range header appropriate for placing in blobstore.BLOB_RANGE_HEADER.

  Raises:
    ValueError if parameters are incorrect.  This happens:
      - start > end.
      - start < 0 and end is also provided.
      - end < 0
      - If index provided AND using the HTTP header, they don't match.
        This is a safeguard.
   N/A N/A N/A end None N/A start None N/A N/A N/A ValueError May not specify end value without start. N/A use_indexes N/A start None N/A use_indexes N/A N/A N/A end None N/A N/A N/A start end N/A N/A N/A ValueError start must be < end. N/A range_indexes N/A _serialize_range start end N/A N/A use_range_set use_range use_indexes N/A N/A N/A range_header range_indexes N/A N/A N/A ValueError N/A May not provide non-equivalent range indexes and range headers: (header) %s != (indexes) %s N/A range_header range_indexes N/A N/A use_range N/A range_header None N/A N/A range_header N/A N/A use_indexes N/A N/A range_indexes N/A N/A None N/A BlobstoreDownloadHandler N/A N/A webapp RequestHandler N/A N/A Base class for creating handlers that may send blobs to users. N/A __use_range_unset N/A object send_blob N/A N/A self blob_key_or_info content_type save_as start end N/A None None None None kwargs N/A N/A Send a blob-response based on a blob_key.

    Sets the correct response header for serving a blob.  If BlobInfo
    is provided and no content_type specified, will set request content type
    to BlobInfo's content type.

    Args:
      blob_key_or_info: BlobKey or BlobInfo record to serve.
      content_type: Content-type to override when known.
      save_as: If True, and BlobInfo record is provided, use BlobInfos
        filename to save-as.  If string is provided, use string as filename.
        If None or False, do not send as attachment.
      start: Start index of content-range to send.
      end: End index of content-range to send.  End index is inclusive.
      use_range: Use provided content range from requests Range header.
        Mutually exclusive to start and end.

    Raises:
      ValueError on invalid save_as parameter.
     N/A N/A N/A set kwargs _SEND_BLOB_PARAMETERS N/A N/A invalid_keywords N/A N/A keyword kwargs N/A N/A N/A keyword _SEND_BLOB_PARAMETERS N/A N/A N/A N/A invalid_keywords append keyword N/A N/A N/A len invalid_keywords 1 N/A N/A N/A TypeError N/A send_blob got unexpected keyword argument %s. N/A invalid_keywords N/A 0 N/A N/A N/A TypeError N/A send_blob got unexpected keyword arguments: %s N/A sorted invalid_keywords N/A use_range N/A N/A kwargs get use_range N/A self __use_range_unset N/A use_range_set N/A use_range N/A self __use_range_unset N/A range_header N/A _check_ranges start end use_range_set use_range N/A N/A N/A N/A self request headers get range None N/A N/A range_header None N/A N/A N/A N/A N/A self response headers N/A N/A blobstore BLOB_RANGE_HEADER range_header N/A N/A isinstance blob_key_or_info N/A blobstore BlobInfo N/A N/A blob_key N/A N/A blob_key_or_info key N/A blob_info blob_key_or_info N/A N/A blob_key blob_key_or_info N/A blob_info None N/A N/A N/A N/A self response headers N/A N/A blobstore BLOB_KEY_HEADER N/A str blob_key N/A content_type N/A N/A N/A isinstance content_type unicode N/A N/A content_type N/A N/A content_type encode utf-8 N/A N/A N/A N/A self response headers N/A Content-Type content_type N/A N/A N/A N/A N/A self response headers N/A Content-Type send_attachment N/A N/A filename N/A N/A N/A N/A isinstance filename unicode N/A N/A filename N/A N/A filename encode utf-8 N/A N/A N/A N/A self response headers N/A Content-Disposition N/A _CONTENT_DISPOSITION_FORMAT filename N/A N/A save_as N/A N/A N/A isinstance save_as basestring N/A N/A N/A send_attachment save_as N/A N/A N/A blob_info N/A save_as True N/A N/A N/A send_attachment N/A blob_info filename N/A N/A N/A blob_info N/A N/A N/A ValueError Expected BlobInfo value for blob_key_or_info. N/A N/A N/A ValueError Unexpected value for save_as. N/A N/A N/A N/A self response clear N/A get_range N/A N/A self N/A N/A N/A Get range from header if it exists.

    A range header of "bytes: 0-100" would return (0, 100).

    Returns:
      Tuple (start, end):
        start: Start index.  None if there is None.
        end: End index (inclusive).  None if there is None.
      None if there is no request header.

    Raises:
      UnsupportedRangeFormatError: If the range format in the header is
        valid, but not supported.
      RangeFormatError: If the range format in the header is not valid.
     N/A range_header N/A N/A N/A N/A self request headers get range None N/A N/A range_header None N/A N/A None N/A N/A N/A parsed_range N/A _parse_bytes range_header N/A N/A N/A TypeError N/A err N/A N/A N/A RangeFormatError N/A Invalid range header: %s err N/A N/A parsed_range None N/A N/A N/A RangeFormatError N/A Invalid range header: %s range_header N/A N/A units ranges parsed_range N/A N/A N/A len ranges 1 N/A N/A N/A UnsupportedRangeFormatError Unable to support multiple range values in Range header. N/A N/A units _BYTES_UNIT N/A N/A N/A UnsupportedRangeFormatError Invalid unit in range header type: %s range_header N/A N/A ranges N/A 0 N/A N/A BlobstoreUploadHandler N/A N/A webapp RequestHandler N/A N/A Base class for creation blob upload handlers. __init__ N/A N/A self N/A args kwargs N/A N/A N/A N/A N/A super BlobstoreUploadHandler self __init__ args kwargs N/A N/A self __uploads None N/A get_uploads N/A N/A self field_name N/A None N/A N/A Get uploads sent to this handler.

    Args:
      field_name: Only select uploads that were sent as a specific field.

    Returns:
      A list of BlobInfo records corresponding to each upload.
      Empty list if there are no blob-info records for field_name.
     N/A N/A N/A self __uploads None N/A N/A N/A self __uploads N/A N/A N/A key value N/A N/A N/A N/A self request params items N/A N/A N/A isinstance value N/A cgi FieldStorage N/A N/A N/A blob-key N/A value type_options N/A N/A N/A N/A N/A N/A N/A self __uploads setdefault key N/A append N/A N/A blobstore parse_blob_info value N/A field_name N/A N/A N/A N/A N/A list N/A N/A self __uploads N/A field_name N/A N/A N/A KeyError N/A N/A N/A N/A N/A results N/A N/A uploads N/A N/A N/A self __uploads itervalues N/A N/A results uploads N/A results N/A N/A