class documentation

class MyBlobWrapper(object): (source)

Constructor: MyBlobWrapper(f)

View In Hierarchy

Wrapper for external Zope file objects to provide blob-like interface.

MyBlobWrapper adapts external file objects (OFS.File.File, OFS.Image.Image) from other Zope containers to provide a consistent blob-like interface compatible with ZMS blob field handling.

Features:

  • Wraps external file objects
  • Provides blob-compatible method signatures
  • Lazy data access through delegation
  • URI data retrieval as base64-encoded data URIs
  • Filename and URL extraction

This class is used for cross-container file references and external file handling while maintaining compatibility with native ZMS blob operations.

Method __init__ Initialize the wrapper around an external file object.
Method __str__ Return the wrapped data decoded as text.
Method getData Return the wrapped file data.
Method getDataURI Return the wrapped file as a data URI.
Method getFilename Return the identifier of the wrapped file object.
Method getHref Return the absolute URL of the wrapped file object.
Class Variable __str____roles__ Undocumented
Class Variable getData__roles__ Undocumented
Class Variable getDataURI__roles__ Undocumented
Class Variable getFilename__roles__ Undocumented
Class Variable getHref__roles__ Undocumented
Instance Variable f Undocumented
def __init__(self, f): (source)

Initialize the wrapper around an external file object.

Parameters
fWrapped file or image object
def __str__(self): (source)

Return the wrapped data decoded as text.

def getData(self, parent=None): (source)

Return the wrapped file data.

Parameters
parentUnused compatibility parameter
Returns
Raw file data
def getDataURI(self): (source)

Return the wrapped file as a data URI.

Returns
strData URI for the wrapped file
def getFilename(self): (source)

Return the identifier of the wrapped file object.

Returns
strFilename or id
def getHref(self, REQUEST): (source)

Return the absolute URL of the wrapped file object.

Parameters
REQUEST:ZPublisher.HTTPRequestTriggering request
Returns
strAbsolute URL
__str____roles__ = (source)

Undocumented

getData__roles__ = (source)

Undocumented

getDataURI__roles__ = (source)

Undocumented

getFilename__roles__ = (source)

Undocumented

getHref__roles__ = (source)

Undocumented

Undocumented