""" This file is part of open source project located at https://github.com/polinom/bunny-xbmc. It is a framework that makes xbmc addons development easy. Feel free to contribute. Author: Polynets Igor """ from xbmc import executebuiltin from datetime import datetime # from etvnet.auth import Auth import urllib2 try: import simplejson as json except: import json from etvnet.define import * def notify(message, header="Message"): executebuiltin("XBMC.Notification(%s,%s)" % (header,message)) # in order to use this cache_responce decorator # 'self' suppose to have 'Cache' object in '_cache' attribute def cache_responce(request_method): def cahed_request_method(self, path, use_cache=True, *args, **kwargs): if use_cache: resp = self._cache.get(path) if not resp: resp = request_method(self, path, *args, **kwargs) self._cache.set(path,resp) return resp else: return request_method(self, path, *args, **kwargs) return cahed_request_method