PEP8 small cleanup

This commit is contained in:
itdominator 2022-02-26 02:49:08 -06:00
parent 7e5d603eb9
commit 8f1c1848fd
4 changed files with 13 additions and 18 deletions

View File

@ -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()

View File

@ -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):

View File

@ -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:

View File

@ -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: