From b790b2a64b8114f68191df9451e7a2e5109e79a4 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 2 Jun 2021 23:29:08 +0100 Subject: [PATCH] Count files in directory --- metadata.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/metadata.py b/metadata.py index 48b106ed5..3be09b864 100644 --- a/metadata.py +++ b/metadata.py @@ -71,8 +71,10 @@ def _getStatusCount(baseDir: str) -> int: continue if 'inbox@' in acct or 'news@' in acct: continue - for f in os.path.join(accountsDir, acct + '/outbox'): - statusCtr += 1 + acctDir = os.path.join(accountsDir, acct + '/outbox') + for subdir2, dirs2, files2 in os.walk(acctDir): + statusCtr += len(files) + break break return statusCtr