develop #11
plugins
archiver
file_properties
git_clone
movie_tv_info
trasher
vod_thumbnailer
src/versions/solarfm-0.0.1/SolarFM/solarfm
__builtins__.py__main__.py
core
controller.pycontroller_data.py
fs_actions
mixins
ui_mixin.pywidgets
__init__.pycontext_menu_widget.py
dialogs
__init__.pyabout_widget.pyappchooser_widget.pyfile_exists_widget.pymessage_widget.pynew_file_widget.pyrename_widget.pysave_load_widget.py
icon_grid_widget.pyicon_tree_widget.pyio_widget.pypopups
__init__.pyio_popup_widget.pymessage_popup_widget.pypath_menu_popup_widget.pyplugins_popup_widget.py
tab_header_widget.pyplugins
utils
user_config/usr/share/solarfm
@@ -6,10 +6,6 @@ import faulthandler
|
||||
import traceback
|
||||
from setproctitle import setproctitle
|
||||
|
||||
import tracemalloc
|
||||
tracemalloc.start()
|
||||
|
||||
|
||||
# Lib imports
|
||||
import gi
|
||||
gi.require_version('Gtk', '3.0')
|
||||
|
@@ -18,6 +18,12 @@ class EventSystem:
|
||||
def subscribe(self, event_type, fn):
|
||||
self.subscribers[event_type].append(fn)
|
||||
|
||||
def unsubscribe(self, event_type, fn):
|
||||
self.subscribers[event_type].remove(fn)
|
||||
|
||||
def unsubscribe_all(self, event_type):
|
||||
self.subscribers.pop(event_type, None)
|
||||
|
||||
def emit(self, event_type, data = None):
|
||||
if event_type in self.subscribers:
|
||||
for fn in self.subscribers[event_type]:
|
||||
@@ -29,8 +35,8 @@ class EventSystem:
|
||||
else:
|
||||
fn()
|
||||
|
||||
# NOTE: Should be used when signal has only one listener and vis-a-vis
|
||||
def emit_and_await(self, event_type, data = None):
|
||||
""" NOTE: Should be used when signal has only one listener and vis-a-vis """
|
||||
if event_type in self.subscribers:
|
||||
for fn in self.subscribers[event_type]:
|
||||
if data:
|
||||
|
Reference in New Issue
Block a user