Skip to content
This repository was archived by the owner on Nov 27, 2024. It is now read-only.

Commit aef8621

Browse files
authored
Merge pull request #39 from Catch-up-TV-and-More/string_callback
[fix] GetDirectory error with callback full path
2 parents a91940d + b1ce4c5 commit aef8621

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

script.module.codequick/lib/codequick/listing.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import logging
77
import os
88
import re
9+
import types
910

1011
# Fix attemp for
1112
import _strptime
@@ -638,6 +639,12 @@ def set_callback(self, callback, *args, **kwargs):
638639
if callback in dispatcher.registered_routes:
639640
callback = dispatcher.registered_routes[callback].callback
640641

642+
# Handle case where callback is a full path to a callback function (i.e. "/resources/lib/foo/boo/")
643+
# but not registered yet because in another python file that the current one
644+
elif not isinstance(callback, types.FunctionType) and self.is_folder:
645+
dispatcher.get_route(callback)
646+
callback = dispatcher.registered_routes[callback].callback
647+
641648
self.path = callback
642649
self._args = args
643650
if kwargs:

0 commit comments

Comments
 (0)