<s> import xbmcplugin , xbmcaddon , xbmcgui , xbmc <EOL> import sys , os , stat , re <EOL> import urllib <EOL> import mrknow_pLog <EOL> scriptID = sys . modules [ "<STR_LIT:__main__>" ] . scriptID <EOL> log = mrknow_pLog . pLog ( ) <EOL> class TVSettings : <EOL> def __init__ ( self ) : <EOL> addon = xbmcaddon . Addon ( scriptID ) <EOL> def showSettings ( self ) : <EOL> xbmcaddon . Addon ( scriptID ) . openSettings ( sys . argv [ <NUM_LIT:0> ] ) <EOL> def getSettings ( self , service ) : <EOL> valDict = { } <EOL> settingsTab = self . getSettingsTab ( ) <EOL> for i in range ( len ( settingsTab ) ) : <EOL> if settingsTab [ i ] [ <NUM_LIT:0> ] == service : <EOL> valDict [ settingsTab [ i ] [ <NUM_LIT:1> ] ] = addon . getSetting ( settingsTab [ i ] [ <NUM_LIT:1> ] ) <EOL> return valDict <EOL> def getSettingsTab ( self ) : <EOL> valTab = [ ] <EOL> strTab = [ ] <EOL> xmlfile = addon . getAddonInfo ( '<STR_LIT:path>' ) + os . path . sep + '<STR_LIT>' + os . path . sep + '<STR_LIT>' <EOL> xmldoc = minidom . parse ( xmlfile ) <EOL> setlist = xmldoc . getElementsByTagName ( '<STR_LIT>' ) <EOL> for i in range ( len ( setlist ) ) : <EOL> try : s = setlist [ i ] . attributes [ "<STR_LIT:id>" ] <EOL> except : pass <EOL> else : <EOL> s = s . value <EOL> tab = s . split ( '<STR_LIT:_>' ) <EOL> strTab . append ( tab [ <NUM_LIT:0> ] ) <EOL> strTab . append ( s ) <EOL> valTab . append ( strTab ) <EOL> strTab = [ ] <EOL> return valTab </s>
