1111import xbmc
1212
1313# Package imports
14- from codequick .utils import CacheProperty , ensure_unicode , ensure_native_str , safe_path
14+ from codequick .utils import ensure_unicode , ensure_native_str , safe_path
1515from codequick .support import dispatcher , script_data , addon_data , logger_id
16- import urlquick
1716
1817__all__ = ["Script" , "Settings" ]
1918
@@ -37,7 +36,7 @@ def __getitem__(self, key):
3736
3837 def __setitem__ (self , key , value ):
3938 """
40- Set an add-on setting.
39+ Set add-on setting.
4140
4241 :param str key: Id of the setting.
4342 :param value: Value of the setting.
@@ -127,16 +126,22 @@ class Script(object):
127126 is_playable = False
128127 is_folder = False
129128
130- # Logging Levels
129+ #: Critical logging level, maps to 'xbmc.LOGFATAL'
131130 CRITICAL = 50
131+ #: Critical logging level, maps to 'xbmc.LOGWARNING'
132132 WARNING = 30
133+ #: Critical logging level, maps to 'xbmc.LOGERROR'
133134 ERROR = 40
135+ #: Critical logging level, maps to 'xbmc.LOGDEBUG'
134136 DEBUG = 10
137+ #: Critical logging level, maps to 'xbmc.LOGNOTICE'
135138 INFO = 20
136139
137- # Notification icon options
140+ #: Kodi notification warning image
138141 NOTIFY_WARNING = 'warning'
142+ #: Kodi notification error image
139143 NOTIFY_ERROR = 'error'
144+ #: Kodi notification info image
140145 NOTIFY_INFO = 'info'
141146
142147 #: Underlining logger object, for advanced use.
@@ -173,17 +178,17 @@ def register(cls, callback):
173178 return dispatcher .register (callback , cls = cls )
174179
175180 @staticmethod
176- def register_metacall (func , * args , ** kwargs ):
181+ def register_delayed_callback (func , * args , ** kwargs ):
177182 """
178183 Register a function that will be executed after kodi has finished listing all listitems.
179184 Sence the function is called after the listitems have been shown, it will not slow anything down.
180- Very useful for fetching extra metadata without slowing down the listing of content.
185+ Very useful for fetching extra metadata for later use without slowing down the listing of content.
181186
182187 :param func: Function that will be called after endOfDirectory is called.
183188 :param args: Positional arguments that will be passed to function.
184189 :param kwargs: Keyword arguments that will be passed to function.
185190 """
186- dispatcher .register_metacall (func , args , kwargs )
191+ dispatcher .register_delayed (func , args , kwargs )
187192
188193 @staticmethod
189194 def log (msg , args = None , lvl = 10 ):
@@ -200,7 +205,7 @@ def log(msg, args=None, lvl=10):
200205 :param msg: The message format string.
201206 :type args: list or tuple
202207 :param args: List of arguments which are merged into msg using the string formatting operator.
203- :param lvl: The logging level to use. default => 10(Debug).
208+ :param lvl: The logging level to use. default => 10 (Debug).
204209
205210 .. Note::
206211 When a log level of 50(CRITICAL) is given, then all debug messages that were previously logged
@@ -313,23 +318,3 @@ def get_info(key, addon_id=None):
313318 os .mkdir (path )
314319
315320 return resp
316-
317- @CacheProperty
318- def icon (self ):
319- """The add-on's icon image path."""
320- return self .get_info ("icon" )
321-
322- @CacheProperty
323- def fanart (self ):
324- """The add-on's fanart image path."""
325- return self .get_info ("fanart" )
326-
327- @CacheProperty
328- def profile (self ):
329- """The add-on's profile data directory path."""
330- return self .get_info ("profile" )
331-
332- @CacheProperty
333- def path (self ):
334- """The add-on's directory path."""
335- return self .get_info ("path" )
0 commit comments