'Init.
Args:
file_object: A file like object.
delete_tempfile: If we create a tempfile, should we delete it when
we\'re done.
journal_mode: If set to "WAL" a "Write-Ahead Log" is created.'

def __init__(self, file_object, delete_tempfile=True, journal_mode='DELETE'):

    self.file_object = file_object
    self.journal_mode = journal_mode
    if hasattr(self.file_object, 'name'):
        self.name = self.file_object.name
        self._delete_file = False
    else:
        self._delete_file = delete_tempfile
        with tempfile.NamedTemporaryFile(delete=False) as fd:
            self.name = fd.name
            data = file_object.read(65536)
            while data:
                fd.write(data)
                data = file_object.read(65536)
