From a12c6fadbc61640daf398a1a11649e2950a33ba5 Mon Sep 17 00:00:00 2001 From: Matt Fields Date: Wed, 31 Oct 2018 04:14:06 +0800 Subject: [PATCH] b2_file: rename B2File.delete_version -> delete --- README.md | 2 +- b2blaze/models/b2_file.py | 4 ++-- changelog.md | 4 ---- tests.py | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4abaf90..ed0089f 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ save_file.close() #### Delete a file version ```python -file.delete_version() +file.delete() ``` This deletes a single version of a file. (See the [docs on File Versions](https://www.backblaze.com/b2/docs/b2_delete_file_version.html) at Backblaze for explanation) diff --git a/b2blaze/models/b2_file.py b/b2blaze/models/b2_file.py index fc629f0..320ca34 100644 --- a/b2blaze/models/b2_file.py +++ b/b2blaze/models/b2_file.py @@ -117,10 +117,10 @@ def delete_all_versions(self, confirm=False): print(version_count, 'file versions') for count, v in enumerate(versions): print('deleting [{}/{}]'.format(count + 1 , version_count)) - v.delete_version() + v.delete() - def delete_version(self): + def delete(self): """ Delete a file version (Does not delete entire file history: only most recent version) """ path = API.delete_file_version params = { diff --git a/changelog.md b/changelog.md index ebf42e1..e82f12d 100644 --- a/changelog.md +++ b/changelog.md @@ -7,14 +7,10 @@ Python version: - Python 3 required! -**Breaking API changes:** - - (B2File) delete: changed to delete_version - **Nonbreaking API changes:** B2File: - hide added -- delete_version added - delete_all_versions(confirm=False) added B2FileList diff --git a/tests.py b/tests.py index 9ccbaec..9f051cd 100644 --- a/tests.py +++ b/tests.py @@ -253,7 +253,7 @@ def test_delete_file_version(self): # Delete version print('test_delete_file_version: file_name', file.file_name) print('test_delete_file_version: file_id', file.file_id) - file.delete_version() + file.delete() # Refresh bucket; getting the the file should fail file2 = bucket.files.get(file_name=file.file_name)