From d98c510eeebf0adf7f704dcb3bc810ac0dc07bcb Mon Sep 17 00:00:00 2001 From: Amir Date: Wed, 15 Apr 2020 22:41:14 -0400 Subject: [PATCH] Fixed https://github.com/amix/vimrc/pull/563/files --- update_plugins.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/update_plugins.py b/update_plugins.py index 5e14e899..634df7ae 100644 --- a/update_plugins.py +++ b/update_plugins.py @@ -53,16 +53,16 @@ vim-abolish https://github.com/tpope/tpope-vim-abolish mru.vim https://github.com/vim-scripts/mru.vim rust.vim https://github.com/rust-lang/rust.vim vim-markdown https://github.com/plasticboy/vim-markdown -gist-vim https://github.com/mattn/gist-vim +vim-gist https://github.com/mattn/vim-gist vim-ruby https://github.com/vim-ruby/vim-ruby typescript-vim https://github.com/leafgarland/typescript-vim vim-javascript https://github.com/pangloss/vim-javascript vim-python-pep8-indent https://github.com/Vimjas/vim-python-pep8-indent """.strip() -GITHUB_ZIP = '%s/archive/master.zip' +GITHUB_ZIP = "%s/archive/master.zip" -SOURCE_DIR = path.join(path.dirname(__file__), 'sources_non_forked') +SOURCE_DIR = path.join(path.dirname(__file__), "sources_non_forked") def download_extract_replace(plugin_name, zip_path, temp_dir, source_dir): @@ -70,13 +70,14 @@ def download_extract_replace(plugin_name, zip_path, temp_dir, source_dir): # Download and extract file in temp dir req = requests.get(zip_path) - open(temp_zip_path, 'wb').write(req.content) + open(temp_zip_path, "wb").write(req.content) zip_f = zipfile.ZipFile(temp_zip_path) zip_f.extractall(temp_dir) plugin_temp_path = path.join( - temp_dir, path.join(temp_dir, '%s-master' % plugin_name)) + temp_dir, path.join(temp_dir, "%s-master" % plugin_name) + ) # Remove the current plugin and replace it with the extracted plugin_dest_path = path.join(source_dir, plugin_name) @@ -87,16 +88,16 @@ def download_extract_replace(plugin_name, zip_path, temp_dir, source_dir): pass shutil.move(plugin_temp_path, plugin_dest_path) - print('Updated {0}'.format(plugin_name)) + print("Updated {0}".format(plugin_name)) def update(plugin): - name, github_url = plugin.split(' ') + name, github_url = plugin.split(" ") zip_path = GITHUB_ZIP % github_url download_extract_replace(name, zip_path, temp_directory, SOURCE_DIR) -if __name__ == '__main__': +if __name__ == "__main__": temp_directory = tempfile.mkdtemp() try: