Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(49)  |  Call(49)  |  Derive(0)  |  Import(0)

        def log(msg, err=False):
    if err:
        xbmc.log(addon.getAddonInfo('name') + ': ' + msg.encode('utf-8'), 
                 xbmc.LOGERROR)    
    else:
        xbmc.output(addon.getAddonInfo('name') + ': ' + msg.encode('utf-8'), 
                    xbmc.LOGDEBUG)    
        


src/t/0/t0mm0-xbmc-plugins-HEAD/plugin.audio.subsonic/resources/lib/Subsonic/Subsonic.py   t0mm0-xbmc-plugins(Download)
    def ping(self):
        Addon.log('ping')
        payload = self.__get_json('ping.view')
        return payload
 
    def get_music_folders(self):
        Addon.log('get_music_folders')
    def get_indexes(self, folder_id):
        Addon.log('get_indexes: ' + folder_id)
        payload = self.__get_json('getIndexes.view', {'musicFolderId': folder_id})
        if payload:
            indexes = payload['indexes'].get('index', False)
    def get_music_directory(self, music_id):
        Addon.log('get_music_directory: ' + music_id)
        payload = self.__get_json('getMusicDirectory.view', {'id': music_id})
        if payload:
            songs = self.listify(payload['directory']['child'])
            self.display_music_directory(songs)
 
    def get_album_list(self, sort, page=0):
        Addon.log('get_album_list: ' + sort)

src/t/0/t0mm0-xbmc-plugins-HEAD/plugin.audio.8tracks/resources/lib/eighttracks.py   t0mm0-xbmc-plugins(Download)
 
        try:
            Addon.log('loading set number')
            f = open(set_path)
            self._set = f.readline().strip()    
            f.close()
        except IOError:
            Addon.log('getting set number')
    def _fetch(self, url, form_data=False):
        if form_data:
            Addon.log('posting: %s %s' % (url, str(form_data)))
            req = urllib2.Request(url, form_data)
        else:
            Addon.log('getting: ' + url)
            return response
        except urllib2.URLError, e:
            Addon.log(str(e), True)
            return False
 

src/t/0/t0mm0-xbmc-plugins-HEAD/plugin.video.muzu.tv/resources/lib/muzutv.py   t0mm0-xbmc-plugins(Download)
    def __fetch(self, url, form_data=False):
        if form_data:
            Addon.log('posting: %s %s' % (url, str(form_data)))
            req = urllib2.Request(url, form_data)
        else:
            Addon.log('getting: ' + url)
            return response
        except urllib2.URLError, e:
            Addon.log(str(e), True)
            return False
 
    def __login(self):
        Addon.log('logging in')
        policy = cookielib.DefaultCookiePolicy(rfc2965=True, strict_rfc2965_unverifiable=False)    
        self.cj = cookielib.MozillaCookieJar(self.cookie_file)
        self.cj.set_policy(policy)

src/t/0/t0mm0-xbmc-plugins-HEAD/plugin.video.crackle/resources/lib/crackle.py   t0mm0-xbmc-plugins(Download)
    def __init__(self, proxy=''):
        self.proxy = proxy
        Addon.log('proxy: ' + proxy)
 
    def get_categories(self):
            p = urllib2.ProxyHandler({'http': self.proxy})
            download = urllib2.build_opener(p).open
            Addon.log('getting with proxy: ' + url)
        else:
            download = urllib2.urlopen
            Addon.log('getting: ' + url)
            return html
        except urllib2.URLError, e:
            Addon.log(str(e), True)
            return False
 

src/t/0/t0mm0-xbmc-plugins-HEAD/plugin.video.freedocast/resources/lib/freedocast.py   t0mm0-xbmc-plugins(Download)
    def resolve_stream(self, url):
        Addon.log('resolving stream: %s' % url)
        chan_page = self.__get_html(url)
        watch_url = re.search('id="player" src="(.+?)"', chan_page).group(1)
        watch_page = self.__get_html(watch_url, referer=self.__build_url(url))
            resolved = '%s app=%s playpath=%s pageurl=%s' % \
                       (streamer, app, play, self.__build_url(watch_url))
            Addon.log('resolved to: %s' % resolved)
        else:
            s = re.search('stream: \'(rtmp.+?)\'', watch_page)
    def resolve_video(self, v_id):
        Addon.log('resolving video: %s' % v_id)
        xml = self.__get_html('PlaylistXml.aspx', {'vid': v_id})
        s = re.search('url="(.+?)"', xml)
        if s:
            resolved = s.group(1)
            Addon.log('resolved to: %s' % resolved)
    def __fetch(self, url, form_data={}, headers=[]):
        opener = urllib2.build_opener()
        opener.addheaders = headers
        if form_data:
            Addon.log('posting: %s %s %s' % (url, str(form_data), str(headers)))

src/t/0/t0mm0-xbmc-plugins-HEAD/plugin.video.ustvnow/resources/lib/ustvnow.py   t0mm0-xbmc-plugins(Download)
    def _fetch(self, url, form_data=False):
        if form_data:
            Addon.log('posting: %s %s' % (url, str(form_data)))
            req = urllib2.Request(url, form_data)
        else:
            Addon.log('getting: ' + url)
            return response
        except urllib2.URLError, e:
            Addon.log(str(e), True)
            return False
 
    def _login(self):
        Addon.log('logging in') 
        self.token = None
        self.cj = cookielib.CookieJar()
        opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(self.cj))

src/t/0/t0mm0-xbmc-plugins-HEAD/plugin.video.roadrunnerrecords/resources/lib/roadrunner.py   t0mm0-xbmc-plugins(Download)
    def _fetch(self, url, form_data=False):
        if form_data:
            Addon.log('posting: %s %s' % (url, str(form_data)))
            req = urllib2.Request(url, form_data)
        else:
            Addon.log('getting: ' + url)
            return response
        except urllib2.URLError, e:
            Addon.log(str(e), True)
            return False