From 514630d3b9c59683b46a0e454eb049d400aa6ad7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 19 Oct 2019 11:19:19 +0100 Subject: [PATCH] Count posts --- posts.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/posts.py b/posts.py index 9052e133..db13e62b 100644 --- a/posts.py +++ b/posts.py @@ -2170,7 +2170,9 @@ def archivePostsForPerson(httpPrefix: str,nickname: str,domain: str,baseDir: str os.mkdir(archiveDir) boxDir = createPersonDir(nickname,domain,baseDir,boxname) postsInBox=os.scandir(boxDir) - noOfPosts=len(postsInBox) + noOfPosts=0 + for f in postsInBox: + noOfPosts+=1 if noOfPosts<=maxPostsInBox: return