Example #1
0
class FavoritesMixin(object):
    def __init__(self, shortcuts_path):
        self.shortcuts = FavoritesIO(os.path.join(shortcuts_path, 'shortcuts'))
        self.capabilities.append('favorites')
        self.on_stop.append(self.save_shortcuts)

    def create_shortcut(self, favorite):
        return self.shortcuts.add_favorite(favorite)

    def remove_shortcut(self, favorite):
        return self.shortcuts.remove_favorite(favorite)

    def get_shortcuts(self):
        return self.shortcuts.get_favorites()

    def save_shortcuts(self):
        self.shortcuts.save()
Example #2
0
class Favorites(object):
    def __init__(self, shortcuts_path):
        self.shortcuts = FavoritesIO(os.path.join(shortcuts_path, 'shortcuts'))
        self.capabilities.append('favorites')
        self.on_stop.append(self.save_shortcuts)

    def create_shortcut(self, favorite):
        return self.shortcuts.add_favorite(favorite)

    def remove_shortcut(self, favorite):
        return self.shortcuts.remove_favorite(favorite)

    def get_shortcuts(self):
        return self.shortcuts.get_favorites()

    def save_shortcuts(self):
        self.shortcuts.save()
Example #3
0
 def __init__(self, shortcuts_path):
     self.shortcuts = FavoritesIO(os.path.join(shortcuts_path, 'shortcuts'))
     self.capabilities.append('favorites')
     self.on_stop.append(self.save_shortcuts)
Example #4
0
 def __init__(self, shortcuts_path):
     self.shortcuts = FavoritesIO(os.path.join(shortcuts_path, 'shortcuts'))
     self.capabilities.append('favorites')
     self.on_stop.append(self.save_shortcuts)