remove superflous totalsize attribute

This commit is contained in:
holger krekel
2025-09-16 12:54:33 +02:00
parent 3a0c629f3b
commit ce4bb97294
2 changed files with 0 additions and 7 deletions

View File

@@ -34,9 +34,6 @@ class MailboxStat:
# all detected files in mailbox top dir
self.extrafiles = []
# total size of all detected files
self.totalsize = 0
# scan all relevant files (without recursion)
old_cwd = os.getcwd()
os.chdir(self.basedir)
@@ -46,14 +43,12 @@ class MailboxStat:
relpath = name + "/" + msg_name
st = os.stat(relpath)
self.messages.append(FileEntry(relpath, st.st_mtime, st.st_size))
self.totalsize += st.st_size
else:
st = os.stat(name)
if S_ISREG(st.st_mode):
self.extrafiles.append(FileEntry(name, st.st_mtime, st.st_size))
if name == "password":
self.last_login = st.st_mtime
self.totalsize += st.st_size
self.extrafiles.sort(key=lambda x: -x.size)
os.chdir(old_cwd)

View File

@@ -10,8 +10,6 @@ from chatmaild.expire import FileEntry, MailboxStat
from chatmaild.expire import main as expiry_main
from chatmaild.fsreport import main as report_main
# XXX basedirsize (used by dovecot quota) needs to be removed after removing files
@pytest.fixture
def basedir1(tmp_path):