diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/context/controller.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/context/controller.py index b801901..2dbf22d 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/context/controller.py +++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/context/controller.py @@ -75,7 +75,7 @@ class Controller(UIMixin, KeyboardSignalsMixin, IPCSignalsMixin, ExceptionHookMi def handle_gui_event_and_set_message(self, type, target, parameters): method = getattr(self.__class__, f"{target}") data = method(*(self, *parameters)) - self.plugins.set_message_on_plugin(type, data) + self.plugins.send_message_to_plugin(type, data) def open_terminal(self, widget=None, eve=None): wid, tid = self.fm_controller.get_active_wid_and_tid() diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/context/mixins/ui/widget_file_action_mixin.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/context/mixins/ui/widget_file_action_mixin.py index 04f7862..1a84305 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/context/mixins/ui/widget_file_action_mixin.py +++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/context/mixins/ui/widget_file_action_mixin.py @@ -210,9 +210,9 @@ class WidgetFileActionMixin: tab = self.get_fm_window(wid).get_tab_by_id(tid) target = f"{tab.get_current_directory()}" - if len(self.to_copy_files) > 0: + if self.to_copy_files: self.handle_files(self.to_copy_files, "copy", target) - elif len(self.to_cut_files) > 0: + elif self.to_cut_files: self.handle_files(self.to_cut_files, "move", target) def delete_files(self): diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/context/mixins/ui/window_mixin.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/context/mixins/ui/window_mixin.py index 9bf1ea4..b1e3878 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/context/mixins/ui/window_mixin.py +++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/context/mixins/ui/window_mixin.py @@ -95,7 +95,7 @@ class WindowMixin(TabMixin): # If something selected self.bottom_size_label.set_label(f"{formatted_mount_free} free / {formatted_mount_size}") self.bottom_path_label.set_label(tab.get_current_directory()) - if len(selected_files) > 0: + if selected_files: uris = self.format_to_uris(store, _wid, _tid, selected_files, True) combined_size = 0 for uri in uris: diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/plugins/plugins.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/plugins/plugins.py index b3a568c..49230f5 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/plugins/plugins.py +++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/plugins/plugins.py @@ -54,15 +54,15 @@ class Plugins: os.chdir(path) sys.path.insert(0, path) - spec = importlib.util.spec_from_file_location(file, join(path, "__main__.py")) - app = importlib.util.module_from_spec(spec) + spec = importlib.util.spec_from_file_location(file, join(path, "__main__.py")) + app = importlib.util.module_from_spec(spec) spec.loader.exec_module(app) - plugin_reference = app.Plugin(self._builder, event_system) - plugin = Plugin() - plugin.name = plugin_reference.get_plugin_name() - plugin.module = path - plugin.reference = plugin_reference + plugin_reference = app.Plugin(self._builder, event_system) + plugin = Plugin() + plugin.name = plugin_reference.get_plugin_name() + plugin.module = path + plugin.reference = plugin_reference self._plugin_collection.append(plugin) except Exception as e: @@ -73,14 +73,9 @@ class Plugins: def reload_plugins(self, file=None): - print(f"Reloading plugins...") - # if self._plugin_collection: - # to_unload = [] - # for dir in self._plugin_collection: - # if not os.path.isdir(os.path.join(self._plugins_path, dir)): - # to_unload.append(dir) + print(f"Reloading plugins... stub.") - def set_message_on_plugin(self, type, data): + def send_message_to_plugin(self, type, data): print("Trying to send message to plugin...") for plugin in self._plugin_collection: if type in plugin.name: