Skip to content

Commit

Permalink
gdrive: add gc command support (#3288)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxhora authored Feb 9, 2020
1 parent e7b3297 commit 90ee067
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dvc/remote/gdrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,13 @@ def create_remote_dir(self, parent_id, title):
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:
Expand Down Expand Up @@ -387,3 +394,7 @@ def all(self):
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)

0 comments on commit 90ee067

Please sign in to comment.