def __init__(self): Screen.__init__(self, 'Weather') # Screen Title self.add(Label(0.13, "screentitle", 0, 0.87, _("Weather"))) self.weather = Weather(self.config.weather_location) location = Label(0.04167, "text", 0.50, 0.13, self.weather.location, font_weight="bold") location.set_anchor_point_from_gravity(clutter.GRAVITY_CENTER) self.add(location) # Show today's weather self.create_day(self.weather.forecasts[0], 0.1, 0.15) # Show tomorrow's weather self.create_day(self.weather.forecasts[1], 0.1, 0.5) # Show day 3 self.create_day(self.weather.forecasts[2], 0.4, 0.5) # Show day 4 self.create_day(self.weather.forecasts[3], 0.7, 0.5)
def setUp(self): """Sets up everything for the test""" EntertainerTest.setUp(self) self.weather = Weather("Bath,England")
def __init__(self, stand_alone): """ Initialize content management dialog @param stand_alone: Boolean, Is this dialog running as a stand alone process """ self.stand_alone = stand_alone self.config = Configuration() self.themes = [] self.weather = Weather() # Load UI with gtk.Builder uifile = os.path.join(self.UI_DIR, 'manager.ui') self.builder = gtk.Builder() self.builder.set_translation_domain('entertainer') self.builder.add_from_file(uifile) # Get content management dialog and bind signal callbacks self.dialog = self.builder.get_object("ManagerDialog") if (self.dialog): callback_dic = { # Dialog-wide callbacks "on_close_button_clicked" : self.on_close_button_clicked, "on_ManagerDialog_destroy" : self.on_dialog_closed, # Media tab "on_button_remove_media_clicked" : self.on_button_remove_media_clicked, "on_button_add_media_clicked" : self.on_button_add_media_clicked, "on_button_edit_media_clicked" : self.on_button_edit_media_clicked, "on_checkbutton_video_metadata_toggled" : self.on_checkbutton_video_metadata_toggled, "on_lyrics_checkbox_toggled" : self.on_lyrics_checkbox_toggled, "on_art_checkbox_toggled" : self.on_art_checkbox_toggled, "on_button_media_rebuild_clicked" : self.on_button_media_rebuild_clicked, # Weather tab "on_button_add_weather_clicked" : self.on_button_add_weather_clicked, "on_button_remove_weather_clicked" : self.on_button_remove_weather_clicked, "on_weather_display_checkbox_toggled" : self.on_weather_display_checkbox_toggled, "on_location_find_button_clicked" : self.on_location_find_button_clicked, "on_location_cancel_button_clicked" : self.on_location_cancel_button_clicked, "on_location_add_button_clicked" : self.on_location_add_button_clicked, "on_location_entry_activate" : self.on_location_entry_activate, # User Interface tab "on_theme_list_cursor_changed" : self.on_theme_list_cursor_changed, "on_theme_add_button_clicked" : self.on_theme_add_button_clicked, "on_theme_remove_button_clicked" : self.on_theme_remove_button_clicked, "on_checkbutton_effects_toggled" : self.on_checkbutton_effects_toggled, "on_combobox_effects_changed" : self.on_combobox_effects_changed, # General tab "on_checkbutton_fullscreen_toggled" : self.on_checkbutton_fullscreen_toggled, "on_checkbutton_autostart_toggled" : self.on_checkbutton_autostart_toggled, "on_checkbutton_systray_icon_toggled" : self.on_checkbutton_systray_icon_toggled, "on_spinbutton_slideshow_step_value_changed": self.on_spinbutton_slideshow_step_value_changed } self.builder.connect_signals(callback_dic) # Initialize dialog widgets with correct values and show dialog self.init_dialog_values_from_configure_file() self.dialog.resize(500, 300) self.dialog.show() # Initialize location list in search dialog result_list = self.builder.get_object("location_results_treeview") store = gtk.ListStore(str) result_list.set_model(store) cell_renderer = gtk.CellRendererText() column = gtk.TreeViewColumn(_("Location"), cell_renderer, text=0) result_list.append_column(column)