2
0
Fork 0

FeedReader: now able to post multiple issues on a new version

This commit is contained in:
Carlos Galindo 2026-05-31 00:51:47 +02:00
commit 11c3103e3b
2 changed files with 30 additions and 27 deletions

View file

@ -18,15 +18,16 @@ import _secrets
class UDSClientReader(FeedReader):
'''Custom feed reader for UDSClient, whose version number appears in a .js file.'''
def __init__(self, target: IssuePoster):
def __init__(self, targets: IssuePoster):
'''Creates a new UDSClient Reader.'''
super().__init__("udsclient", "https://polilabs.upv.es/uds/utility/uds.js", target)
super().__init__("udsclient", "https://polilabs.upv.es/uds/utility/uds.js", targets)
def read_feed(self) -> bool | None:
'''Checks for a new version of udsclient, by checking a .js file.'''
get = requests.get(self.url, timeout = TIMEOUT)
if not self.target.check_req(get, self.name):
return None
for target in self.targets:
if not target.check_req(get, self.name):
return None
match = re.search(r"[/a-zA-Z_-]+udsclient\d+-(\d+\.\d+\.\d+)\.tar\.gz", get.text)
if not match:
return None
@ -55,7 +56,7 @@ class NCAppReader(GithubReader):
'''All GitHub releases readers that must alert Forgejo's `archpkgs`.'''
def __init__(self, app, project):
super().__init__(name = app, project = project,
target = CGJForgejoPoster("archpkgs/" + app))
targets = CGJForgejoPoster("archpkgs/" + app))
# Issue Posters
@ -70,20 +71,18 @@ FEED_READERS = [
# Name FeedType Project TargetProject
################################ Software used in MIST (Gitlab) ###################################
# LanguageTool GHTags languagetool-org/languagetool 36 (sysadmin/boira)
GithubTagReader(name = "LanguageTool", project = "languagetool-org/languagetool",
target = GITLAB_BOIRA_CARGAJI),
GithubTagReader(name = "LanguageTool", project = "languagetool-org/languagetool",
targets = GITLAB_BOIRA_CARGAJI),
# meshcentral GHReleases Ylianst/MeshCentral 36 (sysadmin/boira)
GithubReader(name = "meshcentral", project = "Ylianst/MeshCentral",
target = GITLAB_BOIRA_CARGAJI),
# meshcentral GHReleases Ylianst/MeshCentral archpkgs/meshcentral
GithubReader(name = "meshcentral", project = "Ylianst/MeshCentral",
targets = [GITLAB_BOIRA_CARGAJI, CGJForgejoPoster("archpkgs/meshcentral")]),
# python3-snakes PIPY snakes 37 (packages/python3-snakes)
PIPYReader(name = "python3-snakes", package = "snakes",
target = GITLAB_SNAKES_CARGAJI),
PIPYReader(name = "python3-snakes", package = "snakes",
targets = GITLAB_SNAKES_CARGAJI),
################################ Software that I package (Forgejo) ################################
# pdfbooklet GHReleases Averell7/PdfBooklet archpkgs/pdfbooklet
NCAppReader(app = "pdfbooklet", project = "Averell7/PdfBooklet"),
# meshcentral GHReleases Ylianst/MeshCentral archpkgs/meshcentral
GithubReader(name = "meshcentral", project = "Ylianst/MeshCentral",
target = CGJForgejoPoster("archpkgs/meshcentral")),
# nc-cospend GHReleases eneiluj/cospend-nc archpkgs/nextcloud-app-cospend
NCAppReader(app = "nextcloud-app-cospend", project = "eneiluj/cospend-nc"),
# nc-f_autotagging GHReleases
@ -103,7 +102,7 @@ FEED_READERS = [
# nc-socialsharing GHReleases nextcloud/socialsharing archpkgs/nextcloud-app-socialsharing
NCAppReader(app = "nextcloud-app-socialsharing", project = "nextcloud/socialsharing"),
# udsclient Custom --- archpkgs/udsclient
UDSClientReader(target = CGJForgejoPoster(project="archpkgs/udsclient")),
UDSClientReader(targets = CGJForgejoPoster(project="archpkgs/udsclient")),
# vigil GHReleases valeriansaliou/vigil archpkgs/vigil
NCAppReader(app = "vigil", project = "valeriansaliou/vigil"),
# vigil-local GHReleases valeriansaliou/vigil-local archpkgs/vigil-local