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

Class Asset

src/github_api_tester.py:85–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83
84@dataclasses.dataclass
85class Asset:
86 name: str
87 label: str | None
88 sha256: str
89 contents: bytes | None
90
91 _ASSETS = []
92
93 def __post_init__(self):
94 self.id = len(self._ASSETS)
95 self._ASSETS.append(self)
96
97 def render(self) -> dict:
98 return {
99 "url": quart.url_for("get_asset", id=self.id, _external=True),
100 "browser_download_url": "https://github.invalid/unneeded",
101 "id": self.id,
102 "node_id": "fakenode",
103 "name": self.name,
104 "label": self.label,
105 "state": "uploaded",
106 "content_type": "application/octet-stream",
107 "size": 1000,
108 "download_count": 1000,
109 "created_at": "2020-01-01T00:00:00Z",
110 "updated_at": "2020-01-01T00:00:00Z",
111 "uploader": None,
112 }
113
114
115@dataclasses.dataclass

Callers 1

to_assetMethod · 0.85

Calls

no outgoing calls

Tested by 1

to_assetMethod · 0.68