Beispiel #1
0
 def add_favorites(self):
     favorites_dir = get_favorite_dir()
     for item in self.items:
         if item.is_tick:
             new_path = os.path.join(favorites_dir,
                                     os.path.split(item.image_path)[1])
             shutil.copy2(item.image_path, new_path)
Beispiel #2
0
    def __init__(self):
        gtk.HBox.__init__(self)
        self.connect("expose-event", self.on_page_expose_event)

        self.aibizhi_cache_page = CachePage(Aibizhi())
        self.bizhi360_cache_page = CachePage(Bizhi360())
        self.aibizhi_cache_page.cache_view.try_to_fetch()
        self.bizhi360_cache_page.cache_view.try_to_fetch()

        self.favorites_page = FavoritePage(get_favorite_dir())
        self.pictures_page = LocalPicturePage(get_download_wallpaper_dir())

        self.add_item = AddItem()
        self.pictures_page.select_view.add_items([self.add_item])

        self.task_page = TaskPage()

        self.switch_page = gtk.VBox()
        self.__init_navigatebar()

        self.pack_start(self.navigatebar, False, True)
        self.pack_start(self.switch_page, True, True)

        event_manager.add_callback("switch-to-local-pictures",
                                   self.switch_to_local_pictures)
    def __init__(self):
        gtk.HBox.__init__(self)
        self.connect("expose-event", self.on_page_expose_event)

        self.aibizhi_cache_page = CachePage(Aibizhi())
        self.bizhi360_cache_page = CachePage(Bizhi360())
        self.aibizhi_cache_page.cache_view.try_to_fetch()
        self.bizhi360_cache_page.cache_view.try_to_fetch()

        self.favorites_page = FavoritePage(get_favorite_dir())
        self.pictures_page = LocalPicturePage(get_download_wallpaper_dir())

        self.add_item = AddItem()
        self.pictures_page.select_view.add_items([self.add_item])

        self.task_page = TaskPage()
        
        self.switch_page = gtk.VBox()
        self.__init_navigatebar()

        self.pack_start(self.navigatebar, False, True)
        self.pack_start(self.switch_page, True, True)

        event_manager.add_callback("switch-to-local-pictures", self.switch_to_local_pictures)
def get_favorite_number():
    return len(os.listdir(get_favorite_dir()))
Beispiel #5
0
def get_favorite_number():
    return len(os.listdir(get_favorite_dir()))
 def add_favorites(self):
     favorites_dir = get_favorite_dir()
     for item in self.items:
         if item.is_tick:
             new_path = os.path.join(favorites_dir, os.path.split(item.image_path)[1])
             shutil.copy2(item.image_path, new_path)