Add counter and report for each service checked
This commit is contained in:
parent
eb4228b698
commit
fd915d92a3
1 changed files with 16 additions and 1 deletions
|
@ -146,6 +146,7 @@ class FeedReader:
|
|||
return None
|
||||
return feed.entries[0]
|
||||
|
||||
|
||||
def read_feed(self) -> bool | None:
|
||||
'''Read a feed and post an issue if a new item is found'''
|
||||
entry = self.first_item()
|
||||
|
@ -219,5 +220,19 @@ class GithubReader(GithubTagReader):
|
|||
|
||||
if __name__ == "__main__":
|
||||
from config import FEED_READERS
|
||||
fail = 0
|
||||
ok = 0
|
||||
posted = 0
|
||||
for reader in FEED_READERS:
|
||||
reader.read_feed()
|
||||
res = reader.read_feed()
|
||||
if res == None:
|
||||
print(f"No versions of {reader.name} available.")
|
||||
fail += 1
|
||||
elif res == False:
|
||||
ok += 1
|
||||
elif res == True:
|
||||
print(f"{reader.name} outdated, issue posted!")
|
||||
posted += 1
|
||||
else:
|
||||
print(f"{reader.name} read with status {res}")
|
||||
print(f"I've added {posted} new issues, {fail} items have no versions and {ok} items are up to date.")
|
||||
|
|
Loading…
Reference in a new issue