Revert previous commit
This commit is contained in:
parent
a8e4b7065a
commit
72e1499d27
1 changed files with 2 additions and 8 deletions
|
@ -8,18 +8,12 @@ except ImportError:
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import urllib.request
|
||||||
import zipfile
|
import zipfile
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from os import listdir, path
|
from os import listdir, path
|
||||||
|
|
||||||
if sys.version_info.major > 2:
|
|
||||||
import urllib2 as request
|
|
||||||
else:
|
|
||||||
import urllib.request as request
|
|
||||||
|
|
||||||
|
|
||||||
# --- Globals ----------------------------------------------
|
# --- Globals ----------------------------------------------
|
||||||
PLUGINS = """
|
PLUGINS = """
|
||||||
auto-pairs https://github.com/jiangmiao/auto-pairs
|
auto-pairs https://github.com/jiangmiao/auto-pairs
|
||||||
|
@ -79,7 +73,7 @@ SOURCE_DIR = path.join(path.dirname(__file__), "sources_non_forked_cache")
|
||||||
|
|
||||||
def download_extract_replace(plugin_name, zip_path, temp_dir, source_dir):
|
def download_extract_replace(plugin_name, zip_path, temp_dir, source_dir):
|
||||||
# Download and extract file in temp dir
|
# Download and extract file in temp dir
|
||||||
with request.urlopen(zip_path) as req:
|
with urllib.request.urlopen(zip_path) as req:
|
||||||
zip_f = zipfile.ZipFile(BytesIO(req.read()))
|
zip_f = zipfile.ZipFile(BytesIO(req.read()))
|
||||||
zip_f.extractall(temp_dir)
|
zip_f.extractall(temp_dir)
|
||||||
content_disp = req.headers.get("Content-Disposition")
|
content_disp = req.headers.get("Content-Disposition")
|
||||||
|
|
Loading…
Reference in a new issue