Subversion Repositories sd-xbmc

Compare Revisions

Ignore whitespace Rev 1211 → Rev 1212

/trunk/xbmc-addons/src/script.module.sd-xbmc/lib/sdLog.py
1,13 → 1,13
# -*- coding: utf-8 -*-
import sys
import sys,xbmc
 
scriptID = sys.modules[ "__main__" ].scriptID
 
class pLog:
__DEBUG = 0
__INFO = 1
__WARN = 2
__ERROR = 3
__DEBUG = xbmc.LOGDEBUG
__INFO = xbmc.LOGINFO
__WARN = xbmc.LOGWARNING
__ERROR = xbmc.LOGERROR
 
def __init__(self, prefix = ''):
self.logLevel = self.__INFO
16,7 → 16,7
self.prefix = prefix
def setLevel(self, level):
if level >= 0 and level <= 3:
if level >= 0 and level <= 7:
self.logLevel = level
def info(self, message):
33,5 → 33,7
def log(self, message, level):
if self.logLevel <= level:
print '[%s%s %d] %s' %(str(scriptID),self.prefix, level, message)
msg = '[%s%s %d] %s' %(str(scriptID),self.prefix, level, message )
xbmc.log(msg, level)
# print '[%s%s %d] %s' %(str(scriptID),self.prefix, level, message)
 
/trunk/xbmc-addons/src/plugin.video.polishtv.live/hosts/tvpvod.py
40,7 → 40,6
__settings__ = xbmcaddon.Addon(sys.modules[ "__main__" ].scriptID)
 
def __init__(self):
log.info("Starting TVP.VOD")
self.cm = sdCommon.common()
self.proxy = sdCommon.proxy()
self.parser = sdParser.Parser()
143,6 → 142,7
 
def getRequest(self, url):
try:
log.info('URL: ' + url)
result = self.cm.getURLRequestData({ 'url': url, 'use_host': False, 'use_cookie': False, 'use_post': False, 'return_data': True })
except Exception, exception:
traceback.print_exc()
213,6 → 213,11
if not playMode:
return
 
if "paymethod" in item: # filter out paid content ( 208 = ABO )
payMethod = item["paymethod"]
if payMethod != 0:
return
 
prop = {
'title' : '',
'TVShowTitle': self.name,
/trunk/xbmc-addons/src/plugin.video.polishtv.live/default.py
32,54 → 32,54
 
class PolishLiveTV:
def __init__(self):
log.info('Starting: ' + scriptname + ', version: ' + ptv.getAddonInfo('version'))
self.settings = sdSettings.TVSettings()
self.parser = sdParser.Parser()
self.gui = sdNavigation.sdGUI()
self.cm = sdCommon.common()
self.cache = StorageServer.StorageServer('SDXBMC1', 1)
self.serviceObj = self.cache.cacheFunction(self.getServices)
log.info('Starting: ' + scriptname + ', version: ' + ptv.getAddonInfo('version'))
self.settings = sdSettings.TVSettings()
self.parser = sdParser.Parser()
self.gui = sdNavigation.sdGUI()
self.cm = sdCommon.common()
self.cache = StorageServer.StorageServer('SDXBMC1', 1)
self.serviceObj = self.cache.cacheFunction(self.getServices)
 
def showMainMenu(self):
params = self.parser.getParams()
mode = self.parser.getIntParam(params, 'mode')
name = self.parser.getParam(params, 'name')
service = self.parser.getParam(params, 'service')
record = self.parser.getParam(params, 'record')
self.parser.debugParams(params, dbg)
params = self.parser.getParams()
mode = self.parser.getIntParam(params, 'mode')
name = self.parser.getParam(params, 'name')
service = self.parser.getParam(params, 'service')
record = self.parser.getParam(params, 'record')
self.parser.debugParams(params, dbg)
 
if mode != None:
details = self.getServiceDetails('id', mode)
elif service != None:
details = self.getServiceDetails('name', service)
 
if mode == None and name == None and service == None:
log.info('Wyświetlam menu główne')
self.setMainMenu()
if mode == None and name == None and service == None:
log.info('Wyświetlam menu główne')
self.setMainMenu()
 
elif mode in MENU_TAB and MENU_TAB[mode][2] == True:
log.info('Wyświetlam kategorie: ' + MENU_TAB[mode][0])
self.setMenuItems(MENU_TAB[mode][1])
 
elif mode == 20:
log.info('Wyświetlam ' + MENU_TAB[mode][0])
self.settings.showSettings()
elif mode == 21:
log.info('Wyświetlam ' + MENU_TAB[mode][0])
si = sdServiceInfo.ServiceInfo()
si.getWindow()
elif mode == 20:
log.info('Wyświetlam ' + MENU_TAB[mode][0])
self.settings.showSettings()
elif mode == 21:
log.info('Wyświetlam ' + MENU_TAB[mode][0])
si = sdServiceInfo.ServiceInfo()
si.getWindow()
 
elif (mode != None or service != None) and details != False:
vod = getattr(__import__(details['name']), details['init'])()
if record == 'True':
vod = getattr(__import__(details['name']), details['init'])()
if record == 'True':
vod.handleRecords()
else:
if not details['active']:
d = xbmcgui.Dialog()
res = d.yesno("Serwis nieczynny", "Serwis [B]" + self.cm.html_entity_decode(details['displayName']) + "[/B] jest oznaczony jako nieaktywny.\nCzy na pewno chcesz kontynuować?","","","Nie","Tak")
if res == 0:
exit()
vod.handleService()
if res == 0:
exit()
vod.handleService()
 
def setMainMenu(self):
if ptv.getSetting('default_lite') == 'true':
119,7 → 119,7
self.gui.endDir(True)
 
def getServices(self):
result = self.cm.getURLRequestData({'url': SERVICE_URL, 'use_host': False, 'use_cookie': False, 'use_post': False, 'return_data': True})
result = self.cm.getURLRequestData({'url': SERVICE_URL, 'use_host': False, 'use_cookie': False, 'use_post': False, 'return_data': True})
return _json.loads(result)
 
def getServiceDetails(self, node, value):