mirror of
https://github.com/miurahr/aqtinstall.git
synced 2025-12-17 20:54:38 +03:00
Update _check_mirror()
Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This commit is contained in:
11
aqt/cli.py
11
aqt/cli.py
@@ -94,13 +94,12 @@ class Cli():
|
|||||||
|
|
||||||
def _check_mirror(self, mirror):
|
def _check_mirror(self, mirror):
|
||||||
if mirror is None:
|
if mirror is None:
|
||||||
return
|
pass
|
||||||
elif mirror.startswith('http://') or mirror.startswith('https://') or mirror.startswith('ftp://'):
|
elif mirror.startswith('http://') or mirror.startswith('https://') or mirror.startswith('ftp://'):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
self.parser.print_help()
|
return False
|
||||||
exit(1)
|
return True
|
||||||
return mirror
|
|
||||||
|
|
||||||
def _check_modules_arg(self, qt_version, modules):
|
def _check_modules_arg(self, qt_version, modules):
|
||||||
if modules is None:
|
if modules is None:
|
||||||
@@ -120,7 +119,9 @@ class Cli():
|
|||||||
modules = args.modules
|
modules = args.modules
|
||||||
sevenzip = self._set_sevenzip(args)
|
sevenzip = self._set_sevenzip(args)
|
||||||
mirror = args.base
|
mirror = args.base
|
||||||
self._check_mirror(mirror)
|
if not self._check_mirror(mirror):
|
||||||
|
self.parser.print_help()
|
||||||
|
exit(1)
|
||||||
if not self._check_qt_arg_combination(qt_version, os_name, target, arch):
|
if not self._check_qt_arg_combination(qt_version, os_name, target, arch):
|
||||||
self.logger.warning("Specified target combination is not valid: {} {} {}".format(os_name, target, arch))
|
self.logger.warning("Specified target combination is not valid: {} {} {}".format(os_name, target, arch))
|
||||||
if not self._check_modules_arg(qt_version, modules):
|
if not self._check_modules_arg(qt_version, modules):
|
||||||
|
|||||||
@@ -2,8 +2,7 @@ import aqt
|
|||||||
|
|
||||||
|
|
||||||
def test_cli_help(capsys):
|
def test_cli_help(capsys):
|
||||||
expected = "".join(["show help\n",
|
expected = "".join(["usage: aqt [-h] [--logging-conf LOGGING_CONF] [--logger LOGGER]\n",
|
||||||
"usage: aqt [-h] [--logging-conf LOGGING_CONF] [--logger LOGGER]\n",
|
|
||||||
" {install,tool,list,help} ...\n",
|
" {install,tool,list,help} ...\n",
|
||||||
"\n",
|
"\n",
|
||||||
"Installer for Qt SDK.\n",
|
"Installer for Qt SDK.\n",
|
||||||
|
|||||||
Reference in New Issue
Block a user