def install_package(): actions = get_online_packages() actions = [(lambda _: Action(id=_.id, name=_.name, description=_.description, handler=lambda action: __work(_.install)))(item) for item in actions] __builtins__['actions'] = actions show_palette( Palette('install', "Enter package name to install...", actions))
def remove_plugins(): actions = LocalPackage.all() actions = [ (lambda _: Action(id=_.id, name='%s %s' % (_.id, _.version), handler=lambda action: __work(_.remove)))(item) for item in actions ] show_palette(Palette('remove', "Enter package name to remove...", actions))
def upgrade_package(): actions = LocalPackage.all() actions = [ (lambda _: Action(id=_.id, name='%s %s' % (_.id, _.version), handler=lambda action: _run_in_background( lambda: _upgrade_package(action.id))))(item) for item in actions ] show_palette(Palette('remove', "Enter package name to remove...", actions))
def enable_package(): actions = LocalPackage.all(disabled=True) actions = [ (lambda _: Action(id=_.id, name='%s %s' % (_.id, _.version), handler=lambda action: __work( lambda: _enable_package(action.id))))(item) for item in actions ] show_palette( Palette('disable', "Enter package name to disable...", actions))
def install_package(): pkgs = get_online_packages() pkgs = [x for x in pkgs if LocalPackage.by_name(x.id) is None] actions = [ (lambda _: Action(id=_.id, name=_.name, description=_.description, handler=lambda action: _run_in_background(_.install)) )(item) for item in pkgs ] show_palette( Palette('install', "Enter package name to install...", actions))