def create_cover_pixbuf(self): cover_path = DoubanCover.get_cover(self.chl, try_web=False) if cover_path: try: self.pixbuf = gtk.gdk.pixbuf_new_from_file(cover_path) self.is_loaded_cover = True except gobject.GError: self.pixbuf = app_theme.get_pixbuf("radio/default_cover.png").get_pixbuf() self.is_loaded_cover = False else: self.pixbuf = app_theme.get_pixbuf("radio/default_cover.png").get_pixbuf() self.is_loaded_cover = False
def get_channel_cover(self, channel_info, emit_fetch=True): cover_path = DoubanCover.get_banner(channel_info, try_web=False) if cover_path: try: pixbuf = gtk.gdk.pixbuf_new_from_file(cover_path) except: return self.default_cover else: return pixbuf else: if emit_fetch: self.start_fetch_cover(channel_info) return self.default_cover
def create_cover_pixbuf(self): cover_path = DoubanCover.get_cover(self.chl, try_web=False) if cover_path: try: self.pixbuf = gtk.gdk.pixbuf_new_from_file(cover_path) self.is_loaded_cover = True except gobject.GError: self.pixbuf = app_theme.get_pixbuf( "radio/default_cover.png").get_pixbuf() self.is_loaded_cover = False else: self.pixbuf = app_theme.get_pixbuf( "radio/default_cover.png").get_pixbuf() self.is_loaded_cover = False
def __init__(self, channel_info): TreeItem.__init__(self) self.index = 0 self.column_index = 0 self.side_padding = 5 self.normal_item_height = 55 self.highlight_item_height = 80 self.item_height = self.normal_item_height self.item_width = LIST_WIDTH self.is_highlight = False self.channel_info = channel_info self.icon_width = self.icon_height = 45 cover_path = DoubanCover.get_cover(channel_info, try_web=False) if cover_path: self.normal_pixbuf = gtk.gdk.pixbuf_new_from_file(cover_path) else: self.normal_pixbuf = app_theme.get_pixbuf("radio/default_cover.png").get_pixbuf() self.update_size() self.animation_cache_pixbuf = CachePixbuf() self.animation_timeout = 100 # s self.animation_id = None self.active_size = 45
def __init__(self, channel_info): TreeItem.__init__(self) self.index = 0 self.column_index = 0 self.side_padding = 5 self.normal_item_height = 55 self.highlight_item_height = 80 self.item_height = self.normal_item_height self.item_width = LIST_WIDTH self.is_highlight = False self.channel_info = channel_info self.icon_width = self.icon_height = 45 cover_path = DoubanCover.get_cover(channel_info, try_web=False) if cover_path: self.normal_pixbuf = gtk.gdk.pixbuf_new_from_file(cover_path) else: self.normal_pixbuf = app_theme.get_pixbuf( "radio/default_cover.png").get_pixbuf() self.update_size() self.animation_cache_pixbuf = CachePixbuf() self.animation_timeout = 100 # s self.animation_id = None self.active_size = 45
def fetch_channel_cover(self, channel_info): cover_path = DoubanCover.get_banner(channel_info, try_web=True) if cover_path: self.update_channel_cover(channel_info)
def start_mission(self): cover_path = DoubanCover.get_cover(self.chl, try_web=True) if cover_path: self.delay_render_cover(cover_path)
def start_mission(self): cover_path = DoubanCover.get_cover(self.chl,try_web=True) if cover_path: self.delay_render_cover(cover_path)