diff sat/plugins/plugin_comp_file_sharing.py @ 3932:7af29260ecb8

core: fix and renamed getLocalPath -> get_local_path: - renaming is following global methods renaming to use snake_case - for reasons lost in the mists of time, a `profile` argument was used while checking if `client` is set is enough, and `client.profile` was escaped but actually not used in the path.
author Goffi <goffi@goffi.org>
date Mon, 10 Oct 2022 15:23:59 +0200
parents 3ef988734869
children 412b99c29d83
line wrap: on
line diff
--- a/sat/plugins/plugin_comp_file_sharing.py	Fri Oct 07 22:22:13 2022 +0200
+++ b/sat/plugins/plugin_comp_file_sharing.py	Mon Oct 10 15:23:59 2022 +0200
@@ -322,8 +322,8 @@
 
     def __init__(self, file_sharing):
         self.file_sharing = file_sharing
-        self.file_tmp_dir = file_sharing.host.getLocalPath(
-            None, C.FILES_TMP_DIR, TMP_BUFFER_DIR, component=True, profile=False
+        self.file_tmp_dir = file_sharing.host.get_local_path(
+            None, C.FILES_TMP_DIR, TMP_BUFFER_DIR, component=True
         )
         for old_file in self.file_tmp_dir.iterdir():
             log.debug(f"purging old buffer file at {old_file}")
@@ -369,7 +369,7 @@
         self.host.trigger.add(
             "XEP-0329_parseResult_directory",
             self._getDirectoryMetadataElts)
-        self.files_path = self.host.getLocalPath(None, C.FILES_DIR, profile=False)
+        self.files_path = self.host.get_local_path(None, C.FILES_DIR)
         self.http_port = int(self.host.memory.getConfig(
             'component file-sharing', 'http_upload_port', 8888))
         connection_type = self.host.memory.getConfig(
@@ -532,8 +532,8 @@
                         file_size=utils.getHumanSize(file_data['size'])
                     )
                 )
-        file_tmp_dir = self.host.getLocalPath(
-            None, C.FILES_TMP_DIR, peer_jid.userhost(), component=True, profile=False
+        file_tmp_dir = self.host.get_local_path(
+            None, C.FILES_TMP_DIR, peer_jid.userhost(), component=True
         )
         file_tmp_path = file_data['file_path'] = files_utils.get_unique_name(
             file_tmp_dir/filename)