gdrive: add gc command support (#3288)

This commit is contained in:
Max Risuhin
2020-02-09 18:46:05 +02:00
committed by GitHub
parent e7b3297c2d
commit 90ee067972
+11
View File
@@ -275,6 +275,13 @@ class RemoteGDrive(RemoteBASE):
item.Upload()
return item
@gdrive_retry
def delete_remote_file(self, remote_id):
param = {"id": remote_id}
# it does not create a file on the remote
item = self.drive.CreateFile(param)
item.Delete()
@gdrive_retry
def get_remote_item(self, name, parents_ids):
if not parents_ids:
@@ -387,3 +394,7 @@ class RemoteGDrive(RemoteBASE):
except ValueError:
# We ignore all the non-cache looking files
logger.debug('Ignoring path as "non-cache looking"')
def remove(self, path_info):
remote_id = self.get_remote_id(path_info)
self.delete_remote_file(remote_id)