Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit 1933454

Browse files
feat: access release from assets (#17)
Co-authored-by: JamzumSum <zzzzss990315@gmail.com>
1 parent 15b27d5 commit 1933454

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

poetry.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "AssetsUpdater"
3-
version = "1.4.2"
3+
version = "1.5.0"
44
description = "Update assets from network."
55
authors = ["JamzumSum <zzzzss990315@gmail.com>"]
66
license = "MIT"

src/updater/github.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def pre(self) -> bool:
2020
return self.raw["prerelease"]
2121

2222
def assets(self):
23-
return [Asset(self.tag, i["name"], i["browser_download_url"]) for i in self.raw["assets"]]
23+
return [Asset(self, i["name"], i["browser_download_url"]) for i in self.raw["assets"]]
2424

2525
@property
2626
def title(self) -> str:

src/updater/type.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77

88
@dataclass(frozen=True)
99
class Asset:
10-
from_tag: str
10+
from_release: "Release"
1111
name: str
1212
download_url: str
1313

1414
def __repr__(self) -> str:
1515
return self.name
1616

17+
@property
18+
def from_tag(self) -> str:
19+
return self.from_release.tag
20+
1721

1822
class Release(ABC):
1923
@abstractproperty

0 commit comments

Comments
 (0)