-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix b2cli 604 #90
base: master
Are you sure you want to change the base?
Fix b2cli 604 #90
Conversation
""" | ||
def __init__(self, content_sha1=None): | ||
self.content_sha1 = content_sha1 # NOTE: b2sdk.transfer.upload_manager *writes* to this field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is better to create a setter...
|
||
@abstractmethod | ||
def get_content_sha1(self): | ||
""" | ||
Return a 40-character string containing the hex SHA1 checksum of the data in the file. | ||
Return a 40-character string containing the hex sha1 checksum of the data in the file. | ||
The implementation of this method may cache the checksum value to avoid recalculating it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this design - get_content_sha1
may or may not set the content_sha1
field... :/
@@ -63,6 +67,8 @@ def read(self, size=None): | |||
# Check for end of stream | |||
if size is None or len(data) < size: | |||
self.hash = self.digest.hexdigest() | |||
if self.upload_source is not None: | |||
self.upload_source.content_sha1 = self.hash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bleeeh
file_id, | ||
part_number, | ||
part_upload_source.get_content_length(), | ||
HEX_DIGITS_AT_END, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sha1_checksum?
No description provided.