def browse(*scripts): """browse script's homepage in your web browser""" if len(scripts) >= 1: for index in range(0, len(scripts)): bat = Bat(scripts[index]) bat.open_homepage() else: console('Please use `vimpyre browse <script-name>` and try again!')
def update(*scripts): """update scripts""" if len(scripts) >= 1: for index in range(0, len(scripts)): bat = Bat(scripts[index]) bat.update() else: console('Please use `vimpyre update <script-name>` and try again!')
def install(*scripts): """install scripts""" if len(scripts) >= 1: for index in range(0, len(scripts)): bat = Bat(scripts[index]) bat.install() else: console('Please use `vimpyre install <script-name>` and try again!')
def search(*scripts): """search script""" if len(scripts) > 1: console('Please search one script name!') sys.exit(1) bat = Bat(scripts[0]) rets = bat.search() console('=> => Send bats to search vim-scripts ...') if rets: for item in rets: if path.isdir(path.join(VIM_PATH, 'vimpyre', item['name'])): console('\033[1m%s\033[m => %s \033[1m[installed]\033[m' % (item['name'], item['description'])) else: console( '\033[1m%s\033[m => %s | last: %s' % (item['name'], item['description'], item['updated_at'])) else: console('No such vim-scripts!')
def search(*scripts): """search script""" if len(scripts) > 1: console('Please search one script name!') sys.exit(1) bat = Bat(scripts[0]) rets = bat.search() console('=> => Send bats to search vim-scripts ...') if rets: for item in rets: if path.isdir(path.join(VIM_PATH, 'vimpyre', item['name'])): console('\033[1m%s\033[m => %s \033[1m[installed]\033[m' % ( item['name'], item['description'])) else: console('\033[1m%s\033[m => %s | last: %s' % ( item['name'], item['description'], item['updated_at'])) else: console('No such vim-scripts!')
def list_installed(): bat = Bat() bat.list_installed()
def update_all(): bat = Bat() bat.update_all()
def remove_all(): bat = Bat() bat.remove_all()
def init(): bat = Bat() bat.install_base()