summaryrefslogtreecommitdiff
path: root/src/backend/mirrors.py
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-12-04 22:10:33 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-12-04 22:10:33 +0000
commit99455bbb94f298cd101c3e43227647ccf7aaaf1b (patch)
tree6e1d079bc2a051592d64e5fd1a73b3ea6c2d0123 /src/backend/mirrors.py
parent1965c85d0acc683e1dddb58cec343b2ff62711e4 (diff)
add an aditional matchphrase to the dependency solver, add color support && pep8 the whole backendv4.2212.0
Diffstat (limited to 'src/backend/mirrors.py')
-rw-r--r--src/backend/mirrors.py31
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):