diff options
Diffstat (limited to 'src/backend/mirrors.py')
-rw-r--r-- | src/backend/mirrors.py | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/backend/mirrors.py b/src/backend/mirrors.py index ad02f58..83d83f1 100644 --- a/src/backend/mirrors.py +++ b/src/backend/mirrors.py @@ -2,6 +2,7 @@ import sisyphus.getfs + def getList(): mirrorList = [] @@ -17,6 +18,7 @@ def getList(): return mirrorList + def printList(): mirrorList = getList() @@ -26,17 +28,27 @@ def printList(): else: print(i + 1, ' ', line['Url']) + def writeList(mirrorList): with open(sisyphus.getfs.mirrorCfg, 'w+') as mirrorFile: - mirrorFile.write("#######################################################\n") - mirrorFile.write("# Support for multiple mirrors is somewhat incomplete #\n") - mirrorFile.write("#######################################################\n") - mirrorFile.write("# Please avoid using the Main Repository #\n") - mirrorFile.write("# http://mirrors.redcorelinux.org/redcorelinux #\n") - mirrorFile.write("# as the bandwidth is limited, use mirrors instead #\n") - mirrorFile.write("#######################################################\n") - mirrorFile.write("# Uncomment only one mirror from the list bellow #\n") - mirrorFile.write("#######################################################\n") + mirrorFile.write( + "#######################################################\n") + mirrorFile.write( + "# Support for multiple mirrors is somewhat incomplete #\n") + mirrorFile.write( + "#######################################################\n") + mirrorFile.write( + "# Please avoid using the Main Repository #\n") + mirrorFile.write( + "# http://mirrors.redcorelinux.org/redcorelinux #\n") + mirrorFile.write( + "# as the bandwidth is limited, use mirrors instead #\n") + mirrorFile.write( + "#######################################################\n") + mirrorFile.write( + "# Uncomment only one mirror from the list bellow #\n") + mirrorFile.write( + "#######################################################\n") mirrorFile.write("\n") for line in mirrorList: mirror = 'PORTAGE_BINHOST=' + '"' + line['Url'] + '"' @@ -45,6 +57,7 @@ def writeList(mirrorList): mirrorFile.write(mirror + "\n") mirrorFile.write("\n") + def setActive(mirror): mirrorList = getList() if mirror not in range(1, len(mirrorList) + 1): |