list.sort intsead of sorted(list)

This commit is contained in:
whew 2020-12-22 04:42:29 +00:00 committed by GitHub
parent 96d36a0ae3
commit 393ce284c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -292,12 +292,8 @@ class ShareModeWeb(SendBaseModeWeb):
info["size"] = self.common.dir_size(filename) info["size"] = self.common.dir_size(filename)
info["size_human"] = self.common.human_readable_filesize(info["size"]) info["size_human"] = self.common.human_readable_filesize(info["size"])
self.file_info["dirs"].append(info) self.file_info["dirs"].append(info)
self.file_info["files"] = sorted( self.file_info["files"].sort(key=lambda k: k["basename"])
self.file_info["files"], key=lambda k: k["basename"] self.file_info["dirs"].sort(key=lambda k: k["basename"])
)
self.file_info["dirs"] = sorted(
self.file_info["dirs"], key=lambda k: k["basename"]
)
# Check if there's only 1 file and no folders # Check if there's only 1 file and no folders
if len(self.file_info["files"]) == 1 and len(self.file_info["dirs"]) == 0: if len(self.file_info["files"]) == 1 and len(self.file_info["dirs"]) == 0: