MCPcopy Create free account
hub / github.com/astral-sh/python-build-standalone / Upload

Class Upload

src/github_api_tester.py:116–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114
115@dataclasses.dataclass
116class Upload:
117 name: str
118 label: str | None
119
120 def __post_init__(self):
121 self.hasher = hashlib.sha256()
122 if self.name == "SHA256SUMS":
123 self.contents = b""
124 else:
125 self.contents = None
126
127 def update(self, chunk: bytes) -> None:
128 self.hasher.update(chunk)
129 if self.contents is not None:
130 self.contents += chunk
131
132 def to_asset(self) -> Asset:
133 return Asset(self.name, self.label, self.hasher.hexdigest(), self.contents)
134
135
136@dataclasses.dataclass

Callers 1

upload_assetFunction · 0.85

Calls

no outgoing calls

Tested by 1

upload_assetFunction · 0.68