Ejemplo n.º 1
0
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))
Ejemplo n.º 2
0
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 )
            )
Ejemplo n.º 3
0
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))))
Ejemplo n.º 4
0
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 )
            )
Ejemplo n.º 5
0
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)
                       )
        ))
Ejemplo n.º 6
0
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)))
Ejemplo n.º 7
0
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)
                       )
        )
Ejemplo n.º 8
0
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'))
Ejemplo n.º 9
0
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'))