summaryrefslogtreecommitdiff
path: root/src/backend/checkenv.py
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-10-05 20:19:14 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-10-06 00:15:42 +0100
commit46a8e7d1d6ad459c78616c9ac076d30b09fb87c8 (patch)
treea44ec4a13bfdcc40e51a449f8dd899d315584bec /src/backend/checkenv.py
parentec51bc4be021116013a56a55fc6eb804887c2034 (diff)
have sisyphus print the number of unread news during sync
Diffstat (limited to 'src/backend/checkenv.py')
-rw-r--r--src/backend/checkenv.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/backend/checkenv.py b/src/backend/checkenv.py
index 124ba76..4f540e9 100644
--- a/src/backend/checkenv.py
+++ b/src/backend/checkenv.py
@@ -3,6 +3,7 @@
import os
import subprocess
import sisyphus.getenv
+import sisyphus.getnews
import urllib.request
@@ -22,6 +23,15 @@ def root():
return True if os.getuid() == 0 else False
+def news():
+ n_news = sisyphus.getnews.ld_n_news()
+ r_news_index = sisyphus.getnews.ld_r_news()
+
+ unread_count = len(n_news) - len(r_news_index)
+
+ return unread_count
+
+
def sanity():
actv_brch = sisyphus.getenv.sys_brch()
bhst_addr = sisyphus.getenv.bhst_addr()