import os.path
import shutil
import sys
-import tempfile
import uuid
import zipfile
def get_path_on_drive(file_path):
if os.path.isabs(file_path):
- return tempfile.gettempdir() + file_path
- return tempfile.gettempdir() + '/' + file_path
+ return '/tmp' + file_path
+ return '/tmp/' + file_path
def get_file_id(drive, file_path):
path_on_drive = get_path_on_drive(file_path)
request = drive.files().get_media(fileId=maybe_id, acknowledgeAbuse=True)
- path_in_tmp = tempfile.gettempdir() + '/' + str(uuid.uuid4())
+ path_in_tmp = '/tmp/' + str(uuid.uuid4())
with io.FileIO(path_in_tmp, mode='wb') as stream_input:
downloader = MediaIoBaseDownload(stream_input, request)
done = False