Mercurial > libervia-desktop-kivy
diff cagou/plugins/plugin_transfer_file.py @ 491:203755bbe0fe
massive refactoring from camelCase -> snake_case. See backend commit log for more details
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 08 Apr 2023 13:44:32 +0200 |
parents | 3c9ba4a694ef |
children |
line wrap: on
line diff
--- a/cagou/plugins/plugin_transfer_file.py Sat Apr 08 13:34:55 2023 +0200 +++ b/cagou/plugins/plugin_transfer_file.py Sat Apr 08 13:44:32 2023 +0200 @@ -58,23 +58,23 @@ super(FileTransmitter, self).__init__(*args, **kwargs) if self.native_filechooser: - thread = threading.Thread(target=self._nativeFileChooser) + thread = threading.Thread(target=self._native_file_chooser) thread.start() else: self.add_widget(FileChooserBox(default_path = self.default_path, - callback=self.onFiles, + callback=self.on_files, cancel_cb=partial(self.cancel_cb, self))) - def _nativeFileChooser(self, *args, **kwargs): + def _native_file_chooser(self, *args, **kwargs): title=_("Please select a file to upload") files = filechooser.open_file(title=title, path=self.default_path, multiple=False, preview=True) - # we want to leave the thread when calling onFiles, so we use Clock - Clock.schedule_once(lambda *args: self.onFiles(files=files), 0) + # we want to leave the thread when calling on_files, so we use Clock + Clock.schedule_once(lambda *args: self.on_files(files=files), 0) - def onFiles(self, files): + def on_files(self, files): if files: self.callback(files[0]) else: