def DownloadLineupsCallback(): global lineup_List country = CountryList.findByFullName(Prefs['country']) postalCode = Prefs['postal_code'] if not country or not postalCode: return MessageContainer(L('NoLocationData'), L('SetYourLocationData')) try: # Still cannot pickle, but info in now saved. lineup_List = lineupList(country, postalCode) except Exception, e: #Log.Error( "Exception: %s" % e) Log.Error("Exception lineup_List: %s" % e) return MessageContainer( L('Error'), "%s %s:%s " % (L('ProblemFetchingChannels'), country.abbrev, postalCode))
def DownloadLineupsCallback(sender): Log( "DownloadLineupsCallback ..." ) country = CountryList.findByFullName( Prefs[COUNTRY]) postalCode = Prefs[POSTAL_CODE] if not country or not postalCode: return MessageContainer( L('NoLocationData'), L('SetYourLocationData') ) try: lineupList = LineupList( country, postalCode ) except Exception, e: Log( "Exception: %s" % e ) return MessageContainer( L('Error'), "%s %s:%s " % ( L('ProblemFetchingChannels'), country.abbrev, postalCode ) )
def AddDownloadLineupsItem(dir): Log("Adding DownloadLineupsItem ...") country = CountryList.findByFullName(Prefs[COUNTRY]) if not country: return postalCode = Prefs[POSTAL_CODE] if not postalCode: return lineupList = Dict[LINEUP_LIST] if not lineupList: downloadTitle = L('DownloadChannels') else: downloadTitle = L('ReDownloadChannels') dir.Append( Function( DirectoryItem(DownloadLineupsCallback, downloadTitle, summary=L('DownloadChannelsSummary'), thumb=R(DOWNLOAD_CHANNELS_ICON), art=R(ART))))
def DownloadLineupsCallback(): global lineup_List country = CountryList.findByFullName( Prefs['country']) postalCode = Prefs['postal_code'] if not country or not postalCode: return MessageContainer( L('NoLocationData'), L('SetYourLocationData') ) try: # Still cannot pickle, but info in now saved. lineup_List = lineupList( country, postalCode ) except Exception, e: #Log.Error( "Exception: %s" % e) Log.Error( "Exception lineup_List: %s" % e) return MessageContainer( L('Error'), "%s %s:%s " % ( L('ProblemFetchingChannels'), country.abbrev, postalCode ) )
def AddDownloadLineupsItem( dir ): Log( "Adding DownloadLineupsItem ..." ) country = CountryList.findByFullName( Prefs[COUNTRY]) if not country: return postalCode = Prefs[POSTAL_CODE] if not postalCode: return lineupList = Dict[LINEUP_LIST] if not lineupList: downloadTitle = L('DownloadChannels') else: downloadTitle = L('ReDownloadChannels') dir.Append( Function( DirectoryItem( DownloadLineupsCallback, downloadTitle, summary=L('DownloadChannelsSummary'), thumb=R(DOWNLOAD_CHANNELS_ICON), art=R(ART) ) ))
def AddDownloadLineupsItem(dir): country = CountryList.findByFullName(Prefs['country']) Log("AddDownloadLineupsItem.country :" + Prefs['country']) if not country: return postalCode = Prefs['postal_code'] if not postalCode: return lineup_List = Dict[KEY_LINEUP_LIST] if not lineup_List: downloadTitle = L('DownloadChannels') else: downloadTitle = L('ReDownloadChannels') dir.add( DirectoryObject(key=Callback(DownloadLineupsCallback), title=downloadTitle, tagline="tagline", summary=L('DownloadChannelsSummary'), thumb=R(DOWNLOAD_CHANNELS_ICON), art=R(ART)))
def AddDownloadLineupsItem( dir ): country = CountryList.findByFullName(Prefs['country']) Log("AddDownloadLineupsItem.country :"+ Prefs['country']) if not country: return postalCode = Prefs['postal_code'] if not postalCode: return lineup_List = Dict[KEY_LINEUP_LIST] if not lineup_List: downloadTitle = L('DownloadChannels') else: downloadTitle = L('ReDownloadChannels') dir.add( DirectoryObject( key = Callback(DownloadLineupsCallback), title = downloadTitle, tagline ="tagline", summary=L('DownloadChannelsSummary'), thumb=R(DOWNLOAD_CHANNELS_ICON), art=R(ART) ) )
def CreatePrefs(): Log("Creating preferences ...", True) Prefs.Add(id=device_id, type='text', default='', label=L('DeviceIdPrefLabel')) Prefs.Add(id=tuner_id, type='enum', default='0', label=L('TunerIdPrefLabel'), values='0|1|') Prefs.Add(id=country, type='enum', default=L('CoutryPrefDefault'), label=L('CountryPrefLabel'), values=CountryList.toOptions()) Prefs.Add(id=postal_code, type='text', default='', label=L('PostalCodePrefLabel'))
def CreatePrefs(): Log( "Creating preferences ...", True ) Prefs.Add( id=device_id, type='text', default='', label=L('DeviceIdPrefLabel')) Prefs.Add( id=tuner_id, type='enum', default='0', label=L('TunerIdPrefLabel'), values='0|1|') Prefs.Add( id=country, type='enum', default=L('CoutryPrefDefault'), label=L('CountryPrefLabel'), values=CountryList.toOptions()) Prefs.Add( id=postal_code, type='text', default='', label=L('PostalCodePrefLabel'))