Skip to content

Commit

Permalink
b2_file: rename B2File.delete_version -> delete
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Fields committed Oct 30, 2018
1 parent 006a528 commit a12c6fa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions b2blaze/models/b2_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
4 changes: 0 additions & 4 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a12c6fa

Please sign in to comment.