Skip to content

Commit

Permalink
API breaking change, script.register_delayed_callback to register_del…
Browse files Browse the repository at this point in the history
…ayed
  • Loading branch information
willforde committed Apr 9, 2018
1 parent 4d0e337 commit b40fd23
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion script.module.codequick/lib/codequick/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def _process_results(self, resolved):
# Fetch the first element of the generator and process the rest in the background
elif inspect.isgenerator(resolved):
listitem = self._create_playlist([next(resolved)])
self.register_delayed_callback(self._process_generator, resolved)
self.register_delayed(self._process_generator, resolved)

# Create playlist if resolved is a dict of {title: url}
elif hasattr(resolved, "items"):
Expand Down
2 changes: 1 addition & 1 deletion script.module.codequick/lib/codequick/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def register(cls, callback):
return dispatcher.register(callback, parent=cls)

@staticmethod
def register_delayed_callback(func, *args, **kwargs):
def register_delayed(func, *args, **kwargs):
"""
Register a function that will be executed after kodi has finished listing all listitems.
Sence the function is called after the listitems have been shown, it will not slow anything down.
Expand Down
2 changes: 1 addition & 1 deletion script.module.codequick/lib/codequick/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self):

# Persistent list of currently saved searches
self.search_db = PersistentList(SEARCH_DB)
self.register_delayed_callback(self.close)
self.register_delayed(self.close)

def run(self, remove_entry=None, search=False, first_load=False, **extras):
"""List all saved searches."""
Expand Down
2 changes: 1 addition & 1 deletion script.module.codequick/lib/codequick/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class APIControl(Route):
def __init__(self):
super(APIControl, self).__init__()
self.db = Database()
self.register_delayed_callback(self.db.cleanup)
self.register_delayed(self.db.cleanup)
self.api = API()

def valid_playlistid(self, contentid):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_register_metacall(self):
def tester():
pass

self.script.register_delayed_callback(tester)
self.script.register_delayed(tester)
for callback, _, _ in script.dispatcher.registered_delayed:
if callback is tester:
self.assertTrue(True, "")
Expand Down

0 comments on commit b40fd23

Please sign in to comment.