Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Unified Diff: tools/skp/webpages_playback.py

Issue 1660363002: Delete skp dir in partner bucket before uploading (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Initial upload Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skp/webpages_playback.py
diff --git a/tools/skp/webpages_playback.py b/tools/skp/webpages_playback.py
index 23c6442fa6dfff37ae6c5a8577138e62e33304bf..257fcf4e94878d5ebf0bb4a493fe2b4b546736e8 100644
--- a/tools/skp/webpages_playback.py
+++ b/tools/skp/webpages_playback.py
@@ -375,6 +375,7 @@ class SkPicturePlayback(object):
print '\n\n=======Uploading to Partner bucket %s =======\n\n' % (
PARTNERS_GS_BUCKET)
partner_gs = GoogleStorageDataStore(PARTNERS_GS_BUCKET)
+ partner_gs.delete_path(SKPICTURES_DIR_NAME)
partner_gs.upload_dir_contents(
os.path.join(LOCAL_PLAYBACK_ROOT_DIR, SKPICTURES_DIR_NAME),
dest_dir=SKPICTURES_DIR_NAME,
@@ -493,6 +494,8 @@ class GoogleStorageDataStore(DataStore):
return 'Google Storage'
def does_storage_object_exist(self, *args):
return self.gs.does_storage_object_exist(self._bucket, *args)
+ def delete_path(self, path):
+ return self.gs.delete_file(self._bucket, path)
def download_file(self, *args):
self.gs.download_file(self._bucket, *args)
def upload_dir_contents(self, source_dir, **kwargs):
@@ -507,6 +510,8 @@ class LocalFileSystemDataStore(DataStore):
return self._base_dir
def does_storage_object_exist(self, name, *args):
return os.path.isfile(os.path.join(self._base_dir, name))
+ def delete_path(self, path):
+ shutil.rmtree(path)
def download_file(self, name, local_path, *args):
shutil.copyfile(os.path.join(self._base_dir, name), local_path)
def upload_dir_contents(self, source_dir, dest_dir, **kwargs):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698