Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Fix b2cli 604 #90

wants to merge 4 commits into from

Conversation

mzukowski-reef
Copy link

No description provided.

"""
def __init__(self, content_sha1=None):
self.content_sha1 = content_sha1 # NOTE: b2sdk.transfer.upload_manager *writes* to this field
Copy link
Author

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.
Copy link
Author

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
Copy link
Author

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,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sha1_checksum?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants