mirror of
https://github.com/chatmail/relay.git
synced 2026-05-19 12:28:06 +00:00
remove superflous totalsize attribute
This commit is contained in:
@@ -34,9 +34,6 @@ class MailboxStat:
|
|||||||
# all detected files in mailbox top dir
|
# all detected files in mailbox top dir
|
||||||
self.extrafiles = []
|
self.extrafiles = []
|
||||||
|
|
||||||
# total size of all detected files
|
|
||||||
self.totalsize = 0
|
|
||||||
|
|
||||||
# scan all relevant files (without recursion)
|
# scan all relevant files (without recursion)
|
||||||
old_cwd = os.getcwd()
|
old_cwd = os.getcwd()
|
||||||
os.chdir(self.basedir)
|
os.chdir(self.basedir)
|
||||||
@@ -46,14 +43,12 @@ class MailboxStat:
|
|||||||
relpath = name + "/" + msg_name
|
relpath = name + "/" + msg_name
|
||||||
st = os.stat(relpath)
|
st = os.stat(relpath)
|
||||||
self.messages.append(FileEntry(relpath, st.st_mtime, st.st_size))
|
self.messages.append(FileEntry(relpath, st.st_mtime, st.st_size))
|
||||||
self.totalsize += st.st_size
|
|
||||||
else:
|
else:
|
||||||
st = os.stat(name)
|
st = os.stat(name)
|
||||||
if S_ISREG(st.st_mode):
|
if S_ISREG(st.st_mode):
|
||||||
self.extrafiles.append(FileEntry(name, st.st_mtime, st.st_size))
|
self.extrafiles.append(FileEntry(name, st.st_mtime, st.st_size))
|
||||||
if name == "password":
|
if name == "password":
|
||||||
self.last_login = st.st_mtime
|
self.last_login = st.st_mtime
|
||||||
self.totalsize += st.st_size
|
|
||||||
self.extrafiles.sort(key=lambda x: -x.size)
|
self.extrafiles.sort(key=lambda x: -x.size)
|
||||||
os.chdir(old_cwd)
|
os.chdir(old_cwd)
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ from chatmaild.expire import FileEntry, MailboxStat
|
|||||||
from chatmaild.expire import main as expiry_main
|
from chatmaild.expire import main as expiry_main
|
||||||
from chatmaild.fsreport import main as report_main
|
from chatmaild.fsreport import main as report_main
|
||||||
|
|
||||||
# XXX basedirsize (used by dovecot quota) needs to be removed after removing files
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def basedir1(tmp_path):
|
def basedir1(tmp_path):
|
||||||
|
|||||||
Reference in New Issue
Block a user