(self, source)
return stream
Produces a file object from source.

        source can be either a file object, local filename or a string.
Produces a file object from source.
Produces a file object from source .
def openStream(self, source):
        """Produces a file object from source.

        source can be either a file object, local filename or a string.

        """
        # Already a file object
        if hasattr(source, 'read'):
            stream = source
        else:
            stream = BytesIO(source)

        try:
            stream.seek(stream.tell())
        except:  # pylint:disable=bare-except
            stream = BufferedStream(stream)

        return stream
def openStream ( self , source ) : # Already a file object if hasattr ( source , 'read' ) : stream = source else : stream = BytesIO ( source ) try : stream . seek ( stream . tell ( ) ) except : # pylint:disable=bare-except stream = BufferedStream ( stream ) return stream