From d7a7538686e6b24aef7bae15d90b165df0bbf84c Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sun, 1 Sep 2019 20:53:21 -0700 Subject: [PATCH] Merge SendBaseModeWeb.build_file_list into SendBaseModeWeb.set_file_info function --- onionshare/web/send_base_mode.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/onionshare/web/send_base_mode.py b/onionshare/web/send_base_mode.py index 6deb38ac..6468258a 100644 --- a/onionshare/web/send_base_mode.py +++ b/onionshare/web/send_base_mode.py @@ -111,22 +111,11 @@ class SendBaseModeWeb: # Re-initialize self.init() - # Build the file list - self.build_file_list(filenames) - self.set_file_info_custom(filenames, processed_size_callback) - - def build_file_list(self, filenames): - """ - Build a data structure that describes the list of files that make up - the static website. - """ - self.common.log("BaseModeWeb", "build_file_list") - # Clear the list of files self.files = {} self.root_files = {} - # Loop through the files + # Build the file list for filename in filenames: basename = os.path.basename(filename.rstrip('/')) @@ -152,7 +141,7 @@ class SendBaseModeWeb: for nested_filename in nested_filenames: self.files[os.path.join(normalized_root, nested_filename)] = os.path.join(root, nested_filename) - return True + self.set_file_info_custom(filenames, processed_size_callback) def render_logic(self, path=''): """