Example #1
0
 def gdrive_download_file(self, file_id, to_file, progress_name,
                          no_progress_bar):
     gdrive_file = self.drive.CreateFile({"id": file_id})
     bar_format = (
         "Donwloading {desc:{ncols_desc}.{ncols_desc}}... " +
         Tqdm.format_sizeof(int(gdrive_file["fileSize"]), "B", 1024))
     with Tqdm(bar_format=bar_format,
               desc=progress_name,
               disable=no_progress_bar):
         gdrive_file.GetContentFile(to_file)
Example #2
0
 def _gdrive_download_file(self, item_id, to_file, progress_desc,
                           no_progress_bar):
     param = {"id": item_id}
     # it does not create a file on the remote
     gdrive_file = self._drive.CreateFile(param)
     bar_format = (
         "Downloading {desc:{ncols_desc}.{ncols_desc}}... " +
         Tqdm.format_sizeof(int(gdrive_file["fileSize"]), "B", 1024))
     with Tqdm(bar_format=bar_format,
               desc=progress_desc,
               disable=no_progress_bar):
         gdrive_file.GetContentFile(to_file)