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

Remove unuseful function (reverted from commit 2453a11b)

parent 9df3c6ec
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,13 @@ from . import miscfn
from . import txt
def check_file(filename):
"""Check if file exist
:param filename:
"""
return os.path.isfile(filename)
def dir_must_exist(dir_name):
"""Check necessary directory
:param dir_name:
......@@ -42,12 +49,12 @@ def return_mirror_filename(config):
filename = ""
status = False # status.json or mirrors.json
# decision on file availablity
if os.path.isfile(config["status_file"]):
if check_file(config["status_file"]):
status = True
filename = config["status_file"]
elif os.path.isfile(config["mirror_file"]):
elif check_file(config["mirror_file"]):
filename = config["mirror_file"]
elif os.path.isfile(config["fallback_file"]):
elif check_file(config["fallback_file"]):
filename = config["fallback_file"]
if not filename:
print("\n{}.:! {}{}\n".format(txt.RS,
......
......@@ -164,7 +164,7 @@ def update_mirrors(config):
txt.REPO_SERVER))
result = download_mirrors(config)
else:
if not os.path.isfile(config["mirror_file"]):
if not filefn.check_file(config["mirror_file"]):
print(".: {} {} {} {}".format(txt.WRN_CLR,
txt.MIRROR_FILE,
config["mirror_file"],
......@@ -173,7 +173,7 @@ def update_mirrors(config):
txt.FALLING_BACK,
conf.FALLBACK))
result = (True, False)
if not os.path.isfile(config["fallback_file"]):
if not filefn.check_file(config["fallback_file"]):
print(".: {} {}".format(txt.ERR_CLR, txt.HOUSTON))
result = (False, False)
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