[V3 Downloader] Allow for requiring minimum python version (#1455)

This commit is contained in:
Will
2018-04-02 20:26:07 -04:00
committed by palmtree5
parent 935028addc
commit 728ab6c8c1
2 changed files with 20 additions and 1 deletions

View File

@@ -5,6 +5,8 @@ from sys import path as syspath
from typing import Tuple, Union
import discord
import sys
from redbot.core import Config
from redbot.core import checks
from redbot.core.data_manager import cog_data_path
@@ -275,6 +277,13 @@ class Downloader:
await ctx.send(_("Error, there is no cog by the name of"
" `{}` in the `{}` repo.").format(cog_name, repo_name.name))
return
elif cog.min_python_version > sys.version_info:
await ctx.send(_(
"This cog requires at least python version {}, aborting install.".format(
'.'.join([str(n) for n in cog.min_python_version])
)
))
return
if not await repo_name.install_requirements(cog, self.LIB_PATH):
await ctx.send(_("Failed to install the required libraries for"