mirror of
https://github.com/tomasriveral/nixpkgs-notifier.git
synced 2026-08-12 02:38:37 +02:00
fix: indentation
This commit is contained in:
+33
-33
@@ -234,46 +234,46 @@ def main():
|
|||||||
if pr:
|
if pr:
|
||||||
print(" " + str(pr) + " " + getPRTitle(pr))
|
print(" " + str(pr) + " " + getPRTitle(pr))
|
||||||
|
|
||||||
elif sys.argv[1] == "listen":
|
elif sys.argv[1] == "listen":
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
if trackedPRFile.exists():
|
if trackedPRFile.exists():
|
||||||
# Read a snapshot of the file first so we don't modify
|
# Read a snapshot of the file first so we don't modify
|
||||||
# tracked.txt while iterating over it.
|
# tracked.txt while iterating over it.
|
||||||
with trackedPRFile.open("r") as f:
|
with trackedPRFile.open("r") as f:
|
||||||
tracked_prs = []
|
tracked_prs = []
|
||||||
for line in f:
|
for line in f:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
if not line:
|
if not line:
|
||||||
continue
|
continue
|
||||||
tracked_prs.append(int(line))
|
tracked_prs.append(int(line))
|
||||||
|
|
||||||
for PR in tracked_prs:
|
for PR in tracked_prs:
|
||||||
try:
|
try:
|
||||||
status = fetchStatus(PR)
|
status = fetchStatus(PR)
|
||||||
|
|
||||||
if status == "accepted":
|
if status == "accepted":
|
||||||
print(f"PR #{PR} accepted")
|
print(f"PR #{PR} accepted")
|
||||||
|
|
||||||
if shouldLocalNotify:
|
if shouldLocalNotify:
|
||||||
localNotify(PR)
|
localNotify(PR)
|
||||||
if shouldMatrixNotify:
|
if shouldMatrixNotify:
|
||||||
matrixNotify(PR)
|
matrixNotify(PR)
|
||||||
removeTracker(PR)
|
removeTracker(PR)
|
||||||
print(f"Removed PR #{PR} from tracking")
|
print(f"Removed PR #{PR} from tracking")
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(
|
print(
|
||||||
f"Failed to process PR #{PR}: {e}"
|
f"Failed to process PR #{PR}: {e}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Avoid hammering the tracker website
|
# Avoid hammering the tracker website
|
||||||
sleep(configFetchTime)
|
sleep(configFetchTime)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Listener loop error: {e}")
|
print(f"Listener loop error: {e}")
|
||||||
|
|
||||||
sleep(configTime)
|
sleep(configTime)
|
||||||
else:
|
else:
|
||||||
print("Unknown argument \"" + sys.argv[1] + "\"\nAccepted arguments are:\n add\n remove or rm\n list or ls\n listen")
|
print("Unknown argument \"" + sys.argv[1] + "\"\nAccepted arguments are:\n add\n remove or rm\n list or ls\n listen")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user