当前位置: 首页>>代码示例>>Python>>正文


Python Addon.log方法代码示例

本文整理汇总了Python中t0mm0.common.addon.Addon.log方法的典型用法代码示例。如果您正苦于以下问题:Python Addon.log方法的具体用法?Python Addon.log怎么用?Python Addon.log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在t0mm0.common.addon.Addon的用法示例。


在下文中一共展示了Addon.log方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: PLAY

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import log [as 别名]
def PLAY(url,types,linkback,meta_name):
    infoLabels = GRABMETA(meta_name, types)
    stream_url = urlresolver.HostedMediaFile(url).resolve()
    if stream_url == False:
        Addon.log('Error while trying to resolve %s' % url)
        return VIDEOLINKS(linkback,types,'',meta_name,meta_name)
    meta_name = '[COLOR yellow]'+str(meta_name).replace('SEASON:',' ').replace('EPISODE:','x')+'[/COLOR]'
    liz=xbmcgui.ListItem(meta_name, iconImage= '', thumbnailImage=infoLabels['cover_url'])
    liz.setInfo( type="Video", infoLabels={ "Title": meta_name} )
    liz.setProperty("IsPlayable","true")
    xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=stream_url,isFolder=False,listitem=liz)#; Addon.resolve_url(stream_url)
    meta_name = str(meta_name).replace('[/COLOR]','').replace('[COLOR yellow]','')
    print meta_name
    xbmc.Player().play(stream_url,liz)
开发者ID:Ultraporing,项目名称:jas0npc,代码行数:16,代码来源:default.py

示例2: GoogleSearch

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import log [as 别名]
elif mode == 'googlesearch':
    GoogleSearch(url)
elif mode == 'resolver':
    urlresolver.display_settings()
elif mode == 'metahandlersettings':
    import metahandler
    metahandler.display_settings()
elif mode == 'refresh_meta':
    if video_type == VideoType_Movies:
        refresh_movie(title)
    elif video_type == VideoType_TV:
        Notify('small', 'Refresh TV Show', 'Feature not yet implemented','')
    elif video_type == VideoType_Season:
        season_refresh(title, imdb_id, season)
    elif video_type == VideoType_Episode:
        episode_refresh(title, imdb_id, season, episode)
elif mode == 'watch_mark':  
    if not metaget:
        metaget=metahandlers.MetaData()
    addon.log(video_type + ',' + title + ',' + imdb_id + ',' + season + ',' + episode)
    metaget.change_watched(video_type, title, imdb_id, season=season, episode=episode)
        
    xbmc.executebuiltin("Container.Refresh")
elif mode == 'universalsettings':    
    from universal import _common
    _common.addon.show_settings()

if not play and mode != 'resolver' and mode != 'metahandlersettings' and mode != 'universalsettings':
    addon.end_of_directory()
    search_url = ''
开发者ID:kanalei2002,项目名称:viettv247-xbmc-addons,代码行数:32,代码来源:default.py

示例3: Addon

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import log [as 别名]
import time
import xbmc
import xbmcgui
from t0mm0.common.addon import Addon

SLEEP_MILLIS = 250
addon = Addon('script.module.playbackengine', sys.argv)
PROFILE_PATH = addon.get_profile()
DB_PATH = os.path.join(PROFILE_PATH, 'playbackengine.db')

if not os.path.isdir(PROFILE_PATH):
    os.makedirs(PROFILE_PATH)

try:
    from sqlite3 import dbapi2 as sqlite
    addon.log('Loading sqlite3 as DB engine')
except:
    from pysqlite2 import dbapi2 as sqlite
    addon.log('Loading pysqlite2 as DB engine')

def format_time(seconds):
    minutes,seconds = divmod(seconds, 60)
    if minutes > 60:
        hours,minutes = divmod(minutes, 60)
        return "%02d:%02d:%02d" % (hours, minutes, seconds)
    else:
        return "%02d:%02d" % (minutes, seconds)
        
class Player(xbmc.Player):
    '''
    This class provides a wrapper around the xbmc.Player object that allows for bookmarking capability.
开发者ID:philtimmes,项目名称:addons,代码行数:33,代码来源:playbackengine.py

示例4: ValueError

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import log [as 别名]
try:
    DB_NAME = addon.get_setting("db_name")
    DB_USER = addon.get_setting("db_user")
    DB_PASS = addon.get_setting("db_pass")
    DB_ADDRESS = addon.get_setting("db_address")

    if (
        addon.get_setting("use_remote_db") == "true"
        and DB_ADDRESS is not None
        and DB_USER is not None
        and DB_PASS is not None
        and DB_NAME is not None
    ):
        import mysql.connector as database

        addon.log("Loading MySQL as DB engine")
        DB = "mysql"
    else:
        addon.log("MySQL not enabled or not setup correctly")
        raise ValueError("MySQL not enabled or not setup correctly")
except:
    try:
        from sqlite3 import dbapi2 as database

        addon.log("Loading sqlite3 as DB engine")
    except:
        from pysqlite2 import dbapi2 as database

        addon.log("pysqlite2 as DB engine")
    DB = "sqlite"
    db_dir = os.path.join(xbmc.translatePath("special://database"), "onechannelcache.db")
开发者ID:dkplayaclub,项目名称:1Channel,代码行数:33,代码来源:playback.py

示例5: ValueError

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import log [as 别名]
addon_path = addon.get_path()
sys.path.append((os.path.split(addon_path))[0])

'''
   Use MySQL settings if applicable, else:
       Use SQLIte3 wherever possible, needed for newer versions of XBMC
       Keep pysqlite2 for legacy support
'''
try:
	if  addon.get_setting('use_remote_db')=='true' and \
	    addon.get_setting('db_address') is not None and \
	    addon.get_setting('db_user') is not None and \
	    addon.get_setting('db_pass') is not None and \
	    addon.get_setting('db_name') is not None:
		import mysql.connector as database
		addon.log('Metacontainers - Loading MySQLdb as DB engine', 2)
		DB = 'mysql'
	else:
		raise ValueError('MySQL not enabled or not setup correctly')
except:
	try: 
		from sqlite3 import dbapi2 as database
		addon.log('Metacontainers - Loading sqlite3 as DB engine', 2)
	except: 
		from pysqlite2 import dbapi2 as database
		addon.log('Metacontainers - pysqlite2 as DB engine', 2)
	DB = 'sqlite'

class MetaContainer:

	def __init__(self, path='special://profile/addon_data/script.module.metahandler'):
开发者ID:phuang,项目名称:script.module.metahandler,代码行数:33,代码来源:metacontainers.py

示例6: _convert_date

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import log [as 别名]
        Returns:
            DICT of meta data found on TMDB
            Returns None when not found or error requesting page
        '''      
        url = "%s/%s?language=%s&api_key=%s&%s" % (self.url_prefix, method, self.lang, self.api_key, values)
        addon.log('Requesting TMDB : %s' % url, 0)
        try:
            meta = simplejson.loads(net.http_GET(url,{"Accept":"application/json"}).content)
        except Exception, e:
            addon.log("Error connecting to TMDB: %s " % e, 4)
            return None

        if meta == 'Nothing found.':
            return None
        else:
            addon.log('TMDB Meta: %s' % meta, 0)
            return meta


    def _convert_date(self, string, in_format, out_format):
        ''' Helper method to convert a string date to a given format '''
        strptime = lambda date_string, format: datetime(*(time.strptime(date_string, format)[0:6]))
        try:
            a = strptime(string, in_format).strftime(out_format)
        except Exception, e:
            addon.log('************* Error Date conversion failed: %s' % e, 4)
            return None
        return a
        
        
    def _upd_key(self, meta, key):
开发者ID:moisesfortes,项目名称:tuga-iptv,代码行数:33,代码来源:TMDB.py

示例7: Addon

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import log [as 别名]
_1CH = Addon('plugin.video.1channel', sys.argv)

try:
    DB_NAME = _1CH.get_setting('db_name')
    DB_USER = _1CH.get_setting('db_user')
    DB_PASS = _1CH.get_setting('db_pass')
    DB_ADDR = _1CH.get_setting('db_address')

    if _1CH.get_setting('use_remote_db') == 'true' and \
                    DB_ADDR is not None and \
                    DB_USER is not None and \
                    DB_PASS is not None and \
                    DB_NAME is not None:
        import mysql.connector as orm

        _1CH.log('Loading MySQL as DB engine')
        DB = 'mysql'
    else:
        _1CH.log('MySQL not enabled or not setup correctly')
        raise ValueError('MySQL not enabled or not setup correctly')
except:
    try:
        from sqlite3 import dbapi2 as orm

        _1CH.log('Loading sqlite3 as DB engine')
    except:
        from pysqlite2 import dbapi2 as orm

        _1CH.log('pysqlite2 as DB engine')
    DB = 'sqlite'
    __translated__ = xbmc.translatePath("special://database")
开发者ID:felsandric,项目名称:1Channel,代码行数:33,代码来源:utils.py

示例8: listIndexes

# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import log [as 别名]
            xbmcplugin.addDirectoryItem(int(sys.argv[1]), result['li_url'] , listitem,
                                        isFolder=False)
    xbmcplugin.endOfDirectory(int(sys.argv[1]))

waldo_mode     = addon.queries.get('waldo_mode',    '')
waldo_mod    = addon.queries.get('waldo_mod',   '')
waldo_path    = addon.queries.get('waldo_path',   '')
name     = addon.queries.get('name',    '')
vid_type     = addon.queries.get('vid_type',    '')
title    = addon.queries.get('title',   '')
year     = addon.queries.get('year',    '')
imdb     = addon.queries.get('imdb',    '')
tvdb     = addon.queries.get('tvdb',    '')
season   = addon.queries.get('season',  '')
episode  = addon.queries.get('episode', '')
function = addon.queries.get('function', 'callback')
kwargs   = addon.queries.get('kwargs',  '{}')
receiver = addon.queries.get('receiver','')

addon.log(addon.queries)
if not 'waldo_mode' in addon.queries:
    listIndexes()
elif waldo_mode=='ListIndexBrowsingOptions':
    ListIndexBrowsingOptions(waldo_mod, waldo_path)
elif waldo_mode=='GetAllResults':
    GetAllResults(vid_type,title,year,imdb,tvdb,season,episode)
elif waldo_mode=='ActivateCallback':
    ActivateCallback(function,kwargs, waldo_mod, waldo_path)
elif waldo_mode=='CallModule':
    receiver = import_module(receiver, fromlist=[INDEXES_PATH,PROVIDERS_PATH, waldo_path])
    receiver.callback(addon.queries)
开发者ID:bstrdsmkr,项目名称:plugin.video.waldo,代码行数:33,代码来源:default.py


注:本文中的t0mm0.common.addon.Addon.log方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。