From ed88746cd33c0f861e9c45bf05bf9e44d86089ba Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 6 Jun 2020 20:37:56 +0100 Subject: filesystem module : gather all the folder and file paths used by sisyphus under one module, and expose them to other modules from there --- src/backend/mirror.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/mirror.py') diff --git a/src/backend/mirror.py b/src/backend/mirror.py index 7d041cf..6843e59 100644 --- a/src/backend/mirror.py +++ b/src/backend/mirror.py @@ -1,11 +1,11 @@ #!/usr/bin/python3 -mirrorCfg = '/etc/sisyphus/mirrors.conf' +import sisyphus.filesystem def getList(): mirrorList = [] - with open(mirrorCfg) as mirrorFile: + with open(sisyphus.filesystem.mirrorCfg) as mirrorFile: for line in mirrorFile.readlines(): if 'PORTAGE_BINHOST=' in line: url = line.split("=")[1].replace('"', '').rstrip() @@ -27,7 +27,7 @@ def printList(): print(i + 1, ' ', line['Url']) def writeList(mirrorList): - with open(mirrorCfg, 'w+') as mirrorFile: + with open(sisyphus.filesystem.mirrorCfg, 'w+') as mirrorFile: mirrorFile.write("#######################################################\n") mirrorFile.write("# Support for multiple mirrors is somewhat incomplete #\n") mirrorFile.write("#######################################################\n") -- cgit v1.2.3