'Extracts a bz2 file.
Opens the file for writing and meta pipe the contents bz2file to the new file.'

def extract(self):

    if ARCHIVE_UPLOAD_TEMPDIR.get():
        directory = tempfile.mkdtemp(dir=ARCHIVE_UPLOAD_TEMPDIR.get())
    else:
        directory = tempfile.mkdtemp()
    files = [self.name]
    self._create_files(directory, files)
    return directory
