Ejemplo n.º 1
0
def main():
    if ADDON.getSetting('EraseCache') == 'true':
        try:
            urlcache.URLCache(ADDON_DATA_PATH).erase()
        finally:
            ADDON.setSetting('EraseCache', 'false')#@UndefinedVariable

    if not API_KEY:
        raise Exception(_("No API Key."), _("Enter your Met Office API Key under settings."))

    if len(sys.argv) > 1 and sys.argv[1].isdigit():
        properties.observation()
    if not CURRENT_VIEW:
        properties.daily()
    elif CURRENT_VIEW == '3hourly':
        properties.threehourly()
    elif CURRENT_VIEW == 'forecastmap':
        properties.forecastlayer()
    elif CURRENT_VIEW == 'observationmap':
        properties.observationlayer()
    elif CURRENT_VIEW == 'text':
        properties.text()

    WINDOW.setProperty('WeatherProvider', ADDON.getAddonInfo('name'))#@UndefinedVariable
    WINDOW.setProperty('ObservationLocation', ADDON.getSetting('ObservationLocation'))#@UndefinedVariable
    WINDOW.setProperty('ForecastLocation', ADDON.getSetting('ForecastLocation'))#@UndefinedVariable
    WINDOW.setProperty('RegionalLocation', ADDON.getSetting('RegionalLocation'))#@UndefinedVariable
    WINDOW.setProperty('Location1', ADDON.getSetting('ObservationLocation'))#@UndefinedVariable
    WINDOW.setProperty('Locations', '1')#@UndefinedVariable
Ejemplo n.º 2
0
def main():
    if ADDON.getSetting('EraseCache') == 'true':
        try:
            urlcache.URLCache(ADDON_DATA_PATH).erase()
        finally:
            ADDON.setSetting('EraseCache', 'false')#@UndefinedVariable

    if not API_KEY:
        raise Exception(_("No API Key."), _("Enter your Met Office API Key under settings."))

    if len(sys.argv) > 1 and sys.argv[1].isdigit():
        properties.observation()
    if not CURRENT_VIEW:
        properties.daily()
    elif CURRENT_VIEW == '3hourly':
        properties.threehourly()
    elif CURRENT_VIEW == 'forecastmap':
        properties.forecastlayer()
    elif CURRENT_VIEW == 'observationmap':
        properties.observationlayer()
    elif CURRENT_VIEW == 'text':
        properties.text()

    WINDOW.setProperty('WeatherProvider', ADDON.getAddonInfo('name'))#@UndefinedVariable
    WINDOW.setProperty('WeatherProviderLogo', ADDON_BANNER_PATH)#@UndefinedVariable
    WINDOW.setProperty('ObservationLocation', ADDON.getSetting('ObservationLocation'))#@UndefinedVariable
    WINDOW.setProperty('ForecastLocation', ADDON.getSetting('ForecastLocation'))#@UndefinedVariable
    WINDOW.setProperty('RegionalLocation', ADDON.getSetting('RegionalLocation'))#@UndefinedVariable
    WINDOW.setProperty('Location1', ADDON.getSetting('ForecastLocation'))#@UndefinedVariable
    WINDOW.setProperty('Locations', '1')#@UndefinedVariable

    #Explicitly set unused flags to false, so there are no unusual side
    #effects/residual data when moving from another weather provider.
    WINDOW.setProperty('Daily.IsFetched', '')#@UndefinedVariable
    WINDOW.setProperty('36Hour.IsFetched', '')#@UndefinedVariable
    WINDOW.setProperty('Weekend.IsFetched', '')#@UndefinedVariable
    WINDOW.setProperty('Hourly.IsFetched', '')#@UndefinedVariable
    WINDOW.setProperty('Map.IsFetched', '')#@UndefinedVariable
    WINDOW.setProperty('Today.Sunrise', '')#@UndefinedVariable
    WINDOW.setProperty('Today.Sunset', '')#@UndefinedVariable
    WINDOW.setProperty('Weather.CurrentView', '')#@UndefinedVariable
Ejemplo n.º 3
0
def main():
    if ADDON.getSetting('EraseCache') == 'true':
        try:
            urlcache.URLCache(ADDON_DATA_PATH).erase()
        finally:
            ADDON.setSetting('EraseCache', 'false')  #@UndefinedVariable

    if not API_KEY:
        raise Exception(_("No API Key."),
                        _("Enter your Met Office API Key under settings."))

    if len(sys.argv) > 1 and sys.argv[1].isdigit():
        properties.observation()
    if not CURRENT_VIEW:
        properties.daily()
    elif CURRENT_VIEW == '3hourly':
        properties.threehourly()
    elif CURRENT_VIEW == 'forecastmap':
        properties.forecastlayer()
    elif CURRENT_VIEW == 'observationmap':
        properties.observationlayer()
    elif CURRENT_VIEW == 'text':
        properties.text()

    WINDOW.setProperty('WeatherProvider',
                       ADDON.getAddonInfo('name'))  #@UndefinedVariable
    WINDOW.setProperty(
        'ObservationLocation',
        ADDON.getSetting('ObservationLocation'))  #@UndefinedVariable
    WINDOW.setProperty(
        'ForecastLocation',
        ADDON.getSetting('ForecastLocation'))  #@UndefinedVariable
    WINDOW.setProperty(
        'RegionalLocation',
        ADDON.getSetting('RegionalLocation'))  #@UndefinedVariable
    WINDOW.setProperty(
        'Location1',
        ADDON.getSetting('ObservationLocation'))  #@UndefinedVariable
    WINDOW.setProperty('Locations', '1')  #@UndefinedVariable