Skip to content
Snippets Groups Projects
Commit 690067bd authored by Frede H's avatar Frede H :speech_balloon:
Browse files

http functions honor self.quiet

parent 2a77411b
No related branches found
No related tags found
No related merge requests found
...@@ -178,9 +178,10 @@ def ping_host(host, count=1): ...@@ -178,9 +178,10 @@ def ping_host(host, count=1):
return system_call("ping -c{} {} > /dev/null".format(count, host)) == 0 return system_call("ping -c{} {} > /dev/null".format(count, host)) == 0
def update_mirrors(config): def update_mirrors(config, quiet=False):
"""Download updates from repo.manjaro.org """Download updates from repo.manjaro.org
:param config: :param config:
:param quiet:
:returns: tuple with result for mirrors.json and status.json :returns: tuple with result for mirrors.json and status.json
:rtype: tuple :rtype: tuple
""" """
...@@ -192,21 +193,24 @@ def update_mirrors(config): ...@@ -192,21 +193,24 @@ def update_mirrors(config):
result = None result = None
connected = inet_conn_check() connected = inet_conn_check()
if connected: if connected:
print(".: {} {} {}".format(txt.INF_CLR, if not quiet:
txt.DOWNLOADING_MIRROR_FILE, print(".: {} {} {}".format(txt.INF_CLR,
txt.REPO_SERVER)) txt.DOWNLOADING_MIRROR_FILE,
txt.REPO_SERVER))
result = download_mirrors(config) result = download_mirrors(config)
else: else:
if not filefn.check_file(config["status_file"]): if not filefn.check_file(config["status_file"]):
print(".: {} {} {} {}".format(txt.WRN_CLR, if not quiet:
txt.MIRROR_FILE, print(".: {} {} {} {}".format(txt.WRN_CLR,
config["status_file"], txt.MIRROR_FILE,
txt.IS_MISSING)) config["status_file"],
print(".: {} {} {}".format(txt.WRN_CLR, txt.IS_MISSING))
txt.FALLING_BACK, print(".: {} {} {}".format(txt.WRN_CLR,
conf.MIRROR_FILE)) txt.FALLING_BACK,
conf.MIRROR_FILE))
result = (True, False) result = (True, False)
if not filefn.check_file(config["mirror_file"]): if not filefn.check_file(config["mirror_file"]):
print(".: {} {}".format(txt.ERR_CLR, txt.HOUSTON)) if not quiet:
print(".: {} {}".format(txt.ERR_CLR, txt.HOUSTON))
result = (False, False) result = (False, False)
return result return result
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment