#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
"""
The MIT License (MIT)

Copyright (c) Andrew Brookes 2021
andybrookestar[small snail]gmail[period]com
Permission is hereby granted... 
See https://opensource.org/licenses/MIT for details

"""

import operator
from operator import itemgetter
import requests
import time
import os
import tkinter as tk
from tkinter import ttk
import re
import sys

from tkinter.messagebox import showinfo
from tkinter import font


user = os.getenv("SUDO_USER")
if user is None:
    print (" re-run this program using  'sudo'" )
    sys.exit()
  

Worldwide1="""#Server = http://mirror.rackspace.com/archlinux/$repo/os/$arch
#Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch
"""

Australia1="""#Server = https://mirror.aarnet.edu.au/pub/archlinux/$repo/os/$arch
#Server = http://archlinux.mirror.digitalpacific.com.au/$repo/os/$arch
#Server = https://archlinux.mirror.digitalpacific.com.au/$repo/os/$arch
#Server = http://ftp.iinet.net.au/pub/archlinux/$repo/os/$arch
#Server = http://mirror.internode.on.net/pub/archlinux/$repo/os/$arch
#Server = http://arch.lucassymons.net/$repo/os/$arch
#Server = https://arch.lucassymons.net/$repo/os/$arch
#Server = http://syd.mirror.rackspace.com/archlinux/$repo/os/$arch
#Server = https://syd.mirror.rackspace.com/archlinux/$repo/os/$arch
#Server = http://ftp.swin.edu.au/archlinux/$repo/os/$arch
"""

Austria1="""
#Server = http://mirror.digitalnova.at/archlinux/$repo/os/$arch
#Server = http://mirror.easyname.at/archlinux/$repo/os/$arch
#Server = http://mirror.reisenbauer.ee/archlinux/$repo/os/$arch
#Server = https://mirror.reisenbauer.ee/archlinux/$repo/os/$arch
"""

Bangladesh1="""
#Server = http://mirror.xeonbd.com/archlinux/$repo/os/$arch
"""

Belarus1="""
#Server = http://ftp.byfly.by/pub/archlinux/$repo/os/$arch
#Server = http://mirror.datacenter.by/pub/archlinux/$repo/os/$arch
"""


Belgium1="""
#Server = http://archlinux.cu.be/$repo/os/$arch
#Server = http://archlinux.mirror.kangaroot.net/$repo/os/$arch
#Server = http://mirror.tiguinet.net/arch/$repo/os/$arch
"""
BosniaNHerzegovina1="""
#Server = http://archlinux.mirror.ba/$repo/os/$arch
"""


Brazil1="""
#Server = http://br.mirror.archlinux-br.org/$repo/os/$arch
#Server = http://archlinux.c3sl.ufpr.br/$repo/os/$arch
#Server = http://www.caco.ic.unicamp.br/archlinux/$repo/os/$arch
#Server = https://www.caco.ic.unicamp.br/archlinux/$repo/os/$arch
#Server = http://linorg.usp.br/archlinux/$repo/os/$arch
#Server = http://archlinux.pop-es.rnp.br/$repo/os/$arch
#Server = http://mirror.ufam.edu.br/archlinux/$repo/os/$arch
#Server = http://mirror.ufscar.br/archlinux/$repo/os/$arch
"""

Bulgaria1="""
#Server = https://mirror.darklinux.uk/archlinux/$repo/os/$arch
#Server = http://mirror.host.ag/archlinux/$repo/os/$arch
#Server = http://mirrors.netix.net/archlinux/$repo/os/$arch
#Server = http://mirror.telepoint.bg/archlinux/$repo/os/$arch
#Server = https://mirror.telepoint.bg/archlinux/$repo/os/$arch
#Server = http://mirrors.uni-plovdiv.net/archlinux/$repo/os/$arch
#Server = https://mirrors.uni-plovdiv.net/archlinux/$repo/os/$arch
"""

Cambodia1="""
#Server = http://mirror.sabay.com.kh/archlinux/$repo/os/$arch
#Server = https://mirror.sabay.com.kh/archlinux/$repo/os/$arch
"""
Canada1="""
#Server = https://mirror.0xem.ma/arch/$repo/os/$arch
#Server = http://mirror.cedille.club/archlinux/$repo/os/$arch
#Server = http://archlinux.mirror.colo-serv.net/$repo/os/$arch
#Server = http://mirror.csclub.uwaterloo.ca/archlinux/$repo/os/$arch
#Server = https://mirror.csclub.uwaterloo.ca/archlinux/$repo/os/$arch
#Server = http://mirror2.evolution-host.com/archlinux/$repo/os/$arch
#Server = https://mirror2.evolution-host.com/archlinux/$repo/os/$arch
#Server = http://mirror.its.dal.ca/archlinux/$repo/os/$arch
#Server = http://muug.ca/mirror/archlinux/$repo/os/$arch
#Server = https://muug.ca/mirror/archlinux/$repo/os/$arch
#Server = http://arch.powerfly.ca/$repo/os/$arch
#Server = https://arch.powerfly.ca/$repo/os/$arch
#Server = http://archlinux.mirror.rafal.ca/$repo/os/$arch
#Server = http://mirror.scd31.com/arch/$repo/os/$arch
#Server = https://mirror.scd31.com/arch/$repo/os/$arch
#Server = http://mirror.sergal.org/archlinux/$repo/os/$arch
#Server = https://mirror.sergal.org/archlinux/$repo/os/$arch
"""
Chile1="""
#Server = http://mirror.anquan.cl/archlinux/$repo/os/$arch
#Server = http://mirror.archlinux.cl/$repo/os/$arch
#Server = http://mirror1.cl.netactuate.com/archlinux/$repo/os/$arch
#Server = https://mirror1.cl.netactuate.com/archlinux/$repo/os/$arch
#Server = http://mirror.ufro.cl/archlinux/$repo/os/$arch
#Server = https://mirror.ufro.cl/archlinux/$repo/os/$arch
"""

China1="""
#Server = http://mirrors.163.com/archlinux/$repo/os/$arch
#Server = http://mirrors.bfsu.edu.cn/archlinux/$repo/os/$arch
#Server = https://mirrors.bfsu.edu.cn/archlinux/$repo/os/$arch
#Server = http://mirrors.cqu.edu.cn/archlinux/$repo/os/$arch
#Server = https://mirrors.cqu.edu.cn/archlinux/$repo/os/$arch
#Server = http://mirrors.dgut.edu.cn/archlinux/$repo/os/$arch
#Server = https://mirrors.dgut.edu.cn/archlinux/$repo/os/$arch
#Server = http://mirrors.hit.edu.cn/archlinux/$repo/os/$arch
#Server = https://mirrors.hit.edu.cn/archlinux/$repo/os/$arch
#Server = http://mirror.lzu.edu.cn/archlinux/$repo/os/$arch
#Server = http://mirrors.neusoft.edu.cn/archlinux/$repo/os/$arch
#Server = https://mirrors.neusoft.edu.cn/archlinux/$repo/os/$arch
#Server = http://mirrors.nju.edu.cn/archlinux/$repo/os/$arch
#Server = https://mirrors.nju.edu.cn/archlinux/$repo/os/$arch
#Server = http://mirror.redrock.team/archlinux/$repo/os/$arch
#Server = https://mirror.redrock.team/archlinux/$repo/os/$arch
#Server = https://mirrors.sjtug.sjtu.edu.cn/archlinux/$repo/os/$arch
#Server = http://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
#Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
#Server = http://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch
#Server = https://mirrors.ustc.edu.cn/archlinux/$repo/os/$arch
#Server = http://mirrors.wsyu.edu.cn/archlinux/$repo/os/$arch
#Server = https://mirrors.wsyu.edu.cn/archlinux/$repo/os/$arch
#Server = https://mirrors.xjtu.edu.cn/archlinux/$repo/os/$arch
#Server = http://mirrors.zju.edu.cn/archlinux/$repo/os/$arch
"""

Colombia1="""#Server = http://mirrors.udenar.edu.co/archlinux/$repo/os/$arch"""

Croatia1="""#Server = http://archlinux.iskon.hr/$repo/os/$arch"""

Czechia1="""
#Server = http://mirror.dkm.cz/archlinux/$repo/os/$arch
#Server = https://mirror.dkm.cz/archlinux/$repo/os/$arch
#Server = https://europe.mirror.pkgbuild.com/$repo/os/$arch
#Server = http://ftp.fi.muni.cz/pub/linux/arch/$repo/os/$arch
#Server = http://ftp.linux.cz/pub/linux/arch/$repo/os/$arch
#Server = http://gluttony.sin.cvut.cz/arch/$repo/os/$arch
#Server = https://gluttony.sin.cvut.cz/arch/$repo/os/$arch
#Server = http://mirrors.nic.cz/archlinux/$repo/os/$arch
#Server = http://ftp.sh.cvut.cz/arch/$repo/os/$arch
#Server = https://ftp.sh.cvut.cz/arch/$repo/os/$arch
#Server = http://mirror.vpsfree.cz/archlinux/$repo/os/$arch
"""
Denmark1="""
#Server = http://mirrors.dotsrc.org/archlinux/$repo/os/$arch
#Server = https://mirrors.dotsrc.org/archlinux/$repo/os/$arch
#Server = http://mirror.one.com/archlinux/$repo/os/$arch
#Server = https://mirror.one.com/archlinux/$repo/os/$arch
"""
Ecuador1="""
#Server = http://mirror.cedia.org.ec/archlinux/$repo/os/$arch
#Server = http://mirror.espoch.edu.ec/archlinux/$repo/os/$arch
#Server = http://mirror.uta.edu.ec/archlinux/$repo/os/$arch
"""
Estonia1="""
#Server = http://mirror.cspacehostings.com/archlinux/$repo/os/$arch
#Server = https://mirror.cspacehostings.com/archlinux/$repo/os/$arch
#Server = http://mirrors.xtom.ee/archlinux/$repo/os/$arch
#Server = https://mirrors.xtom.ee/archlinux/$repo/os/$arch
"""
Finland1="""
#Server = https://arch.mcstrugs.org/$repo/os/$arch
#Server = http://mirror.arctic.lol/ArchMirror/$repo/os/$arch
#Server = http://arch.mirror.far.fi/$repo/os/$arch
#Server = http://mirror.hosthink.net/archlinux/$repo/os/$arch
#Server = https://mirror.srv.fail/archlinux/$repo/os/$arch
#Server = http://mirror.wuki.li/archlinux/$repo/os/$arch
#Server = https://mirror.wuki.li/archlinux/$repo/os/$arch
#Server = http://arch.yhtez.xyz/$repo/os/$arch
#Server = https://arch.yhtez.xyz/$repo/os/$arch
"""
France1="""
#Server = http://archlinux.de-labrusse.fr/$repo/os/$arch
#Server = http://mirror.archlinux.ikoula.com/archlinux/$repo/os/$arch
#Server = https://archlinux.vi-di.fr/$repo/os/$arch
#Server = http://archlinux.mirrors.benatherton.com/$repo/os/$arch
#Server = http://mirror.cyberbits.eu/archlinux/$repo/os/$arch
#Server = https://mirror.cyberbits.eu/archlinux/$repo/os/$arch
#Server = http://archlinux.datagr.am/$repo/os/$arch
#Server = https://mirrors.eric.ovh/arch/$repo/os/$arch
#Server = http://mirror.ibcp.fr/pub/archlinux/$repo/os/$arch
#Server = http://mirror.lastmikoi.net/archlinux/$repo/os/$arch
#Server = https://arch-mirror.cloud.louifox.house/$repo/os/$arch
#Server = http://archlinux.mailtunnel.eu/$repo/os/$arch
#Server = https://archlinux.mailtunnel.eu/$repo/os/$arch
#Server = http://mir.archlinux.fr/$repo/os/$arch
#Server = http://mirrors.celianvdb.fr/archlinux/$repo/os/$arch
#Server = https://mirrors.celianvdb.fr/archlinux/$repo/os/$arch
#Server = http://arch.nimukaito.net/$repo/os/$arch
#Server = https://arch.nimukaito.net/$repo/os/$arch
#Server = http://mirror.oldsql.cc/archlinux/$repo/os/$arch
#Server = https://mirror.oldsql.cc/archlinux/$repo/os/$arch
#Server = http://archlinux.mirrors.ovh.net/archlinux/$repo/os/$arch
#Server = http://archlinux.polymorf.fr/$repo/os/$arch
#Server = http://archlinux.rezopole.net/$repo/os/$arch
#Server = https://mirrors.slaanesh.org/archlinux/$repo/os/$arch
#Server = http://mirrors.standaloneinstaller.com/archlinux/$repo/os/$arch
#Server = https://mirror.sysa.tech/archlinux/$repo/os/$arch
#Server = https://mirror.thekinrar.fr/archlinux/$repo/os/$arch
#Server = http://ftp.u-strasbg.fr/linux/distributions/archlinux/$repo/os/$arch
#Server = https://mirror.wormhole.eu/archlinux/$repo/os/$arch
#Server = http://mirroir.wptheme.fr/archlinux/$repo/os/$arch
#Server = https://mirroir.wptheme.fr/archlinux/$repo/os/$arch
#Server = http://arch.yourlabs.org/$repo/os/$arch
#Server = https://arch.yourlabs.org/$repo/os/$arch
"""
Georgia1="""
#Server = http://archlinux.grena.ge/$repo/os/$arch
#Server = https://archlinux.grena.ge/$repo/os/$arch
"""
Germany1="""
#Server = http://mirror.23m.com/archlinux/$repo/os/$arch
#Server = https://mirror.23m.com/archlinux/$repo/os/$arch
#Server = http://ftp.agdsn.de/pub/mirrors/archlinux/$repo/os/$arch
#Server = https://ftp.agdsn.de/pub/mirrors/archlinux/$repo/os/$arch
#Server = https://appuals.com/archlinux/$repo/os/$arch
#Server = http://artfiles.org/archlinux.org/$repo/os/$arch
#Server = https://mirror.bethselamin.de/$repo/os/$arch
#Server = http://mirror.chaoticum.net/arch/$repo/os/$arch
#Server = https://mirror.chaoticum.net/arch/$repo/os/$arch
#Server = http://mirror.checkdomain.de/archlinux/$repo/os/$arch
#Server = https://mirror.checkdomain.de/archlinux/$repo/os/$arch
#Server = http://mirror.clientvps.com/archlinux/$repo/os/$arch
#Server = https://mirror.clientvps.com/archlinux/$repo/os/$arch
#Server = https://mirror.dogado.de/archlinux/$repo/os/$arch
#Server = http://mirror.f4st.host/archlinux/$repo/os/$arch
#Server = https://mirror.f4st.host/archlinux/$repo/os/$arch
#Server = http://ftp.fau.de/archlinux/$repo/os/$arch
#Server = https://ftp.fau.de/archlinux/$repo/os/$arch
#Server = https://pkg.fef.moe/archlinux/$repo/os/$arch
#Server = https://dist-mirror.fem.tu-ilmenau.de/archlinux/$repo/os/$arch
#Server = http://mirror.fsrv.services/archlinux/$repo/os/$arch
#Server = https://mirror.fsrv.services/archlinux/$repo/os/$arch
#Server = https://mirror.gnomus.de/$repo/os/$arch
#Server = http://www.gutscheindrache.com/mirror/archlinux/$repo/os/$arch
#Server = http://ftp.gwdg.de/pub/linux/archlinux/$repo/os/$arch
#Server = http://archlinux.honkgong.info/$repo/os/$arch
#Server = http://ftp.hosteurope.de/mirror/ftp.archlinux.org/$repo/os/$arch
#Server = http://ftp-stud.hs-esslingen.de/pub/Mirrors/archlinux/$repo/os/$arch
#Server = http://archlinux.mirror.iphh.net/$repo/os/$arch
#Server = https://mirror.iusearchbtw.nl/$repo/os/$arch
#Server = http://arch.jensgutermuth.de/$repo/os/$arch
#Server = https://arch.jensgutermuth.de/$repo/os/$arch
#Server = http://mirror.kumi.systems/archlinux/$repo/os/$arch
#Server = https://mirror.kumi.systems/archlinux/$repo/os/$arch
#Server = http://mirror.fra10.de.leaseweb.net/archlinux/$repo/os/$arch
#Server = https://mirror.fra10.de.leaseweb.net/archlinux/$repo/os/$arch
#Server = http://mirror.metalgamer.eu/archlinux/$repo/os/$arch
#Server = https://mirror.metalgamer.eu/archlinux/$repo/os/$arch
#Server = http://mirror.mikrogravitation.org/archlinux/$repo/os/$arch
#Server = https://mirror.mikrogravitation.org/archlinux/$repo/os/$arch
#Server = https://mirror.pkgbuild.com/$repo/os/$arch
#Server = http://mirror.moson.org/arch/$repo/os/$arch
#Server = https://mirror.moson.org/arch/$repo/os/$arch
#Server = http://mirrors.n-ix.net/archlinux/$repo/os/$arch
#Server = https://mirrors.n-ix.net/archlinux/$repo/os/$arch
#Server = http://mirror.netcologne.de/archlinux/$repo/os/$arch
#Server = https://mirror.netcologne.de/archlinux/$repo/os/$arch
#Server = http://mirrors.niyawe.de/archlinux/$repo/os/$arch
#Server = https://mirrors.niyawe.de/archlinux/$repo/os/$arch
#Server = http://mirror.orbit-os.com/archlinux/$repo/os/$arch
#Server = https://mirror.orbit-os.com/archlinux/$repo/os/$arch
#Server = http://packages.oth-regensburg.de/archlinux/$repo/os/$arch
#Server = https://packages.oth-regensburg.de/archlinux/$repo/os/$arch
#Server = http://phinau.de/arch/$repo/os/$arch
#Server = https://phinau.de/arch/$repo/os/$arch
#Server = https://mirror.pseudoform.org/$repo/os/$arch
#Server = https://www.ratenzahlung.de/mirror/archlinux/$repo/os/$arch
#Server = http://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch
#Server = https://ftp.halifax.rwth-aachen.de/archlinux/$repo/os/$arch
#Server = http://linux.rz.rub.de/archlinux/$repo/os/$arch
#Server = http://mirror.satis-faction.de/archlinux/$repo/os/$arch
#Server = https://mirror.satis-faction.de/archlinux/$repo/os/$arch
#Server = http://mirror.selfnet.de/archlinux/$repo/os/$arch
#Server = https://mirror.selfnet.de/archlinux/$repo/os/$arch
#Server = http://ftp.spline.inf.fu-berlin.de/mirrors/archlinux/$repo/os/$arch
#Server = https://ftp.spline.inf.fu-berlin.de/mirrors/archlinux/$repo/os/$arch
#Server = http://archlinux.thaller.ws/$repo/os/$arch
#Server = https://archlinux.thaller.ws/$repo/os/$arch
#Server = http://ftp.tu-chemnitz.de/pub/linux/archlinux/$repo/os/$arch
#Server = http://mirror.ubrco.de/archlinux/$repo/os/$arch
#Server = https://mirror.ubrco.de/archlinux/$repo/os/$arch
#Server = http://mirror.undisclose.de/archlinux/$repo/os/$arch
#Server = https://mirror.undisclose.de/archlinux/$repo/os/$arch
#Server = http://ftp.uni-bayreuth.de/linux/archlinux/$repo/os/$arch
#Server = http://ftp.uni-hannover.de/archlinux/$repo/os/$arch
#Server = http://ftp.uni-kl.de/pub/linux/archlinux/$repo/os/$arch
#Server = http://mirror.united-gameserver.de/archlinux/$repo/os/$arch
#Server = https://arch.unixpeople.org/$repo/os/$arch
#Server = http://ftp.wrz.de/pub/archlinux/$repo/os/$arch
#Server = https://ftp.wrz.de/pub/archlinux/$repo/os/$arch
#Server = http://mirror.wtnet.de/arch/$repo/os/$arch
#Server = https://mirror.wtnet.de/arch/$repo/os/$arch
#Server = http://mirrors.xtom.de/archlinux/$repo/os/$arch
#Server = https://mirrors.xtom.de/archlinux/$repo/os/$arch
#Server = http://arch.mirror.zachlge.org/$repo/os/$arch
#Server = https://arch.mirror.zachlge.org/$repo/os/$arch
"""
Greece1="""
#Server = http://ftp.cc.uoc.gr/mirrors/linux/archlinux/$repo/os/$arch
#Server = https://repo.greeklug.gr/data/pub/linux/archlinux/$repo/os/$arch
#Server = http://mirrors.myaegean.gr/linux/archlinux/$repo/os/$arch
#Server = http://ftp.ntua.gr/pub/linux/archlinux/$repo/os/$arch
#Server = http://ftp.otenet.gr/linux/archlinux/$repo/os/$arch
"""
HongKong1="""
#Server = https://asia.mirror.pkgbuild.com/$repo/os/$arch
#Server = http://mirror-hk.koddos.net/archlinux/$repo/os/$arch
#Server = https://mirror-hk.koddos.net/archlinux/$repo/os/$arch
#Server = http://hkg.mirror.rackspace.com/archlinux/$repo/os/$arch
#Server = https://hkg.mirror.rackspace.com/archlinux/$repo/os/$arch
#Server = https://arch-mirror.wtako.net/$repo/os/$arch
#Server = http://mirror.xtom.com.hk/archlinux/$repo/os/$arch
#Server = https://mirror.xtom.com.hk/archlinux/$repo/os/$arch
"""
Hungary1="""
#Server = http://ftp.ek-cer.hu/pub/mirrors/ftp.archlinux.org/$repo/os/$arch
#Server = http://archmirror.hbit.sztaki.hu/archlinux/$repo/os/$arch
#Server = http://nova.quantum-mirror.hu/mirrors/pub/archlinux/$repo/os/$arch
#Server = http://quantum-mirror.hu/mirrors/pub/archlinux/$repo/os/$arch
#Server = http://super.quantum-mirror.hu/mirrors/pub/archlinux/$repo/os/$arch
#Server = https://nova.quantum-mirror.hu/mirrors/pub/archlinux/$repo/os/$arch
#Server = https://quantum-mirror.hu/mirrors/pub/archlinux/$repo/os/$arch
#Server = https://super.quantum-mirror.hu/mirrors/pub/archlinux/$repo/os/$arch
"""

Iceland1="""
#Server = http://mirror.system.is/arch/$repo/os/$arch
#Server = https://mirror.system.is/arch/$repo/os/$arch
"""
India1="""
#Server = http://mirror.cse.iitk.ac.in/archlinux/$repo/os/$arch
#Server = http://mirrors.piconets.webwerks.in/archlinux-mirror/$repo/os/$arch
#Server = https://mirrors.piconets.webwerks.in/archlinux-mirror/$repo/os/$arch
"""
Indonesia1="""
#Server = http://mirror.cloudweeb.com/archlinux/$repo/os/$arch
#Server = http://mirror.faizuladib.com/archlinux/$repo/os/$arch
#Server = http://mirror.gi.co.id/archlinux/$repo/os/$arch
#Server = https://mirror.gi.co.id/archlinux/$repo/os/$arch
#Server = http://vpsmurah.jagoanhosting.com/archlinux/$repo/os/$arch
#Server = https://vpsmurah.jagoanhosting.com/archlinux/$repo/os/$arch
#Server = http://mirror.labkom.id/archlinux/$repo/os/$arch
#Server = http://mirror.papua.go.id/archlinux/$repo/os/$arch
#Server = https://mirror.papua.go.id/archlinux/$repo/os/$arch
#Server = http://mirror.poliwangi.ac.id/archlinux/$repo/os/$arch
#Server = http://mirror.repository.id/archlinux/$repo/os/$arch
#Server = https://mirror.repository.id/archlinux/$repo/os/$arch
#Server = http://suro.ubaya.ac.id/archlinux/$repo/os/$arch
#Server = http://mirror.telkomuniversity.ac.id/archlinux/$repo/os/$arch
#Server = https://mirror.telkomuniversity.ac.id/archlinux/$repo/os/$arch
"""
Iran1="""
#Server = http://mirror.hostiran.ir/archlinux/$repo/os/$arch
#Server = https://mirror.hostiran.ir/archlinux/$repo/os/$arch
#Server = http://repo.iut.ac.ir/repo/archlinux/$repo/os/$arch
#Server = http://mirror.nak-mci.ir/arch/$repo/os/$arch
#Server = http://mirror.rasanegar.com/archlinux/$repo/os/$arch
#Server = https://mirror.rasanegar.com/archlinux/$repo/os/$arch
"""
Ireland1="""
#Server = http://ftp.heanet.ie/mirrors/ftp.archlinux.org/$repo/os/$arch
#Server = https://ftp.heanet.ie/mirrors/ftp.archlinux.org/$repo/os/$arch
"""
Israel1="""
#Server = http://mirror.isoc.org.il/pub/archlinux/$repo/os/$arch
#Server = https://mirror.isoc.org.il/pub/archlinux/$repo/os/$arch
#Server = https://archlinux.mivzakim.net/$repo/os/$arch
"""
Italy1="""
#Server = https://archmirror.it/repos/$repo/os/$arch
#Server = http://archlinux.mirror.garr.it/archlinux/$repo/os/$arch
#Server = http://mirrors.prometeus.net/archlinux/$repo/os/$arch
#Server = http://archlinux.mirror.server24.net/$repo/os/$arch
#Server = https://archlinux.mirror.server24.net/$repo/os/$arch
"""
Japan1="""
#Server = http://mirrors.cat.net/archlinux/$repo/os/$arch
#Server = https://mirrors.cat.net/archlinux/$repo/os/$arch
#Server = http://ftp.tsukuba.wide.ad.jp/Linux/archlinux/$repo/os/$arch
#Server = http://ftp.jaist.ac.jp/pub/Linux/ArchLinux/$repo/os/$arch
#Server = https://ftp.jaist.ac.jp/pub/Linux/ArchLinux/$repo/os/$arch
"""
Kazakhstan1="""
#Server = http://mirror.hoster.kz/archlinux/$repo/os/$arch
#Server = https://mirror.hoster.kz/archlinux/$repo/os/$arch
#Server = http://mirror.ps.kz/archlinux/$repo/os/$arch
#Server = https://mirror.ps.kz/archlinux/$repo/os/$arch
"""
Kenya1="""
#Server = http://archlinux.mirror.liquidtelecom.com/$repo/os/$arch
#Server = https://archlinux.mirror.liquidtelecom.com/$repo/os/$arch
"""
Latvia1="""#Server = http://archlinux.koyanet.lv/archlinux/$repo/os/$arch
#Server = https://archlinux.koyanet.lv/archlinux/$repo/os/$arch
"""
Lithuania1="""
#Server = http://mirrors.atviras.lt/archlinux/$repo/os/$arch
#Server = https://mirrors.atviras.lt/archlinux/$repo/os/$arch
#Server = http://mirrors.ims.nksc.lt/archlinux/$repo/os/$arch
#Server = https://mirrors.ims.nksc.lt/archlinux/$repo/os/$arch
"""
Luxembourg1="""
#Server = http://archlinux.mirror.root.lu/$repo/os/$arch
"""

Mexico1="""
#Server = https://arch.mirror.jsc.mx/$repo/os/$arch
"""

Moldova1="""
#Server = http://mirror.ihost.md/archlinux/$repo/os/$arch
#Server = https://mirror.ihost.md/archlinux/$repo/os/$arch
"""
Monaco1="""
#Server = http://archlinux.qontinuum.space/$repo/os/$arch
#Server = https://archlinux.qontinuum.space:4443/$repo/os/$arch
"""
Netherlands1="""
#Server = http://mirror.cj2.nl/archlinux/$repo/os/$arch
#Server = https://mirror.cj2.nl/archlinux/$repo/os/$arch
#Server = https://mirrors.daan.vodka/archlinux/$repo/os/$arch
#Server = http://mirror.erickochen.nl/archlinux/$repo/os/$arch
#Server = https://mirror.erickochen.nl/archlinux/$repo/os/$arch
#Server = http://mirror.i3d.net/pub/archlinux/$repo/os/$arch
#Server = https://mirror.i3d.net/pub/archlinux/$repo/os/$arch
#Server = https://arch.jeweet.net/$repo/os/$arch
#Server = http://mirrors.kamey.tk/archlinux/$repo/os/$arch
#Server = https://mirrors.kamey.tk/archlinux/$repo/os/$arch
#Server = http://mirror.koddos.net/archlinux/$repo/os/$arch
#Server = https://mirror.koddos.net/archlinux/$repo/os/$arch
#Server = http://arch.mirrors.lavatech.top/$repo/os/$arch
#Server = https://arch.mirrors.lavatech.top/$repo/os/$arch
#Server = http://mirror.ams1.nl.leaseweb.net/archlinux/$repo/os/$arch
#Server = https://mirror.ams1.nl.leaseweb.net/archlinux/$repo/os/$arch
#Server = http://archlinux.mirror.liteserver.nl/$repo/os/$arch
#Server = https://archlinux.mirror.liteserver.nl/$repo/os/$arch
#Server = http://mirror.lyrahosting.com/archlinux/$repo/os/$arch
#Server = https://mirror.lyrahosting.com/archlinux/$repo/os/$arch
#Server = http://mirror.mijn.host/archlinux/$repo/os/$arch
#Server = https://mirror.mijn.host/archlinux/$repo/os/$arch
#Server = http://mirror.neostrada.nl/archlinux/$repo/os/$arch
#Server = https://mirror.neostrada.nl/archlinux/$repo/os/$arch
#Server = http://ftp.nluug.nl/os/Linux/distr/archlinux/$repo/os/$arch
#Server = http://archlinux.mirror.pcextreme.nl/$repo/os/$arch
#Server = https://archlinux.mirror.pcextreme.nl/$repo/os/$arch
#Server = http://mirror.serverion.com/archlinux/$repo/os/$arch
#Server = https://mirror.serverion.com/archlinux/$repo/os/$arch
#Server = http://ftp.snt.utwente.nl/pub/os/linux/archlinux/$repo/os/$arch
#Server = http://mirror.tarellia.net/distr/archlinux/$repo/os/$arch
#Server = https://mirror.tarellia.net/distr/archlinux/$repo/os/$arch
#Server = http://archlinux.mirror.wearetriple.com/$repo/os/$arch
#Server = https://archlinux.mirror.wearetriple.com/$repo/os/$arch
#Server = http://mirror-archlinux.webruimtehosting.nl/$repo/os/$arch
#Server = https://mirror-archlinux.webruimtehosting.nl/$repo/os/$arch
#Server = http://mirrors.xtom.nl/archlinux/$repo/os/$arch
#Server = https://mirrors.xtom.nl/archlinux/$repo/os/$arch
"""
NewCaledonia1="""
#Server = http://mirror.lagoon.nc/pub/archlinux/$repo/os/$arch
#Server = http://archlinux.nautile.nc/archlinux/$repo/os/$arch
#Server = https://archlinux.nautile.nc/archlinux/$repo/os/$arch
"""
NewZealand1="""
#Server = http://mirror.2degrees.nz/archlinux/$repo/os/$arch
#Server = https://mirror.2degrees.nz/archlinux/$repo/os/$arch
#Server = http://mirror.fsmg.org.nz/archlinux/$repo/os/$arch
#Server = https://mirror.fsmg.org.nz/archlinux/$repo/os/$arch
#Server = http://mirror.smith.geek.nz/archlinux/$repo/os/$arch
#Server = https://mirror.smith.geek.nz/archlinux/$repo/os/$arch
"""
NorthMacedonia1="""
#Server = http://arch.softver.org.mk/archlinux/$repo/os/$arch
#Server = http://mirror.onevip.mk/archlinux/$repo/os/$arch
#Server = http://mirror.t-home.mk/archlinux/$repo/os/$arch
#Server = https://mirror.t-home.mk/archlinux/$repo/os/$arch
"""
Norway1="""
#Server = http://mirror.archlinux.no/$repo/os/$arch
#Server = https://mirror.archlinux.no/$repo/os/$arch
#Server = http://archlinux.uib.no/$repo/os/$arch
#Server = http://mirror.neuf.no/archlinux/$repo/os/$arch
#Server = https://mirror.neuf.no/archlinux/$repo/os/$arch
#Server = http://mirror.terrahost.no/linux/archlinux/$repo/os/$arch
"""
Pakistan1="""#Server = http://repo.inara.pk/archlinux/$repo/os/$arch
#Server = https://repo.inara.pk/archlinux/$repo/os/$arch
"""

Paraguay1="""
#Server = http://archlinux.mirror.py/archlinux/$repo/os/$arch
"""
Poland1="""
#Server = http://ftp.icm.edu.pl/pub/Linux/dist/archlinux/$repo/os/$arch
#Server = https://ftp.icm.edu.pl/pub/Linux/dist/archlinux/$repo/os/$arch
#Server = http://mirror.juniorjpdj.pl/archlinux/$repo/os/$arch
#Server = https://mirror.juniorjpdj.pl/archlinux/$repo/os/$arch
#Server = http://arch.midov.pl/arch/$repo/os/$arch
#Server = https://arch.midov.pl/arch/$repo/os/$arch
#Server = http://arch.nixlab.pl/$repo/os/$arch
#Server = https://arch.nixlab.pl/$repo/os/$arch
#Server = http://mirror.onet.pl/pub/mirrors/archlinux/$repo/os/$arch
#Server = http://piotrkosoft.net/pub/mirrors/ftp.archlinux.org/$repo/os/$arch
#Server = http://ftp.psnc.pl/linux/archlinux/$repo/os/$arch
#Server = https://ftp.psnc.pl/linux/archlinux/$repo/os/$arch
#Server = http://mirror.sfinae.tech/pub/mirrors/archlinux/$repo/os/$arch
#Server = https://mirror.sfinae.tech/pub/mirrors/archlinux/$repo/os/$arch
#Server = http://repo.skni.umcs.pl/archlinux/$repo/os/$arch
#Server = https://repo.skni.umcs.pl/archlinux/$repo/os/$arch
#Server = http://ftp.vectranet.pl/archlinux/$repo/os/$arch
"""
Portugal1="""
#Server = http://glua.ua.pt/pub/archlinux/$repo/os/$arch
#Server = https://glua.ua.pt/pub/archlinux/$repo/os/$arch
#Server = http://ftp.rnl.tecnico.ulisboa.pt/pub/archlinux/$repo/os/$arch
#Server = https://ftp.rnl.tecnico.ulisboa.pt/pub/archlinux/$repo/os/$arch
"""
Romania1="""
#Server = http://mirrors.chroot.ro/archlinux/$repo/os/$arch
#Server = https://mirrors.chroot.ro/archlinux/$repo/os/$arch
#Server = http://mirror.efect.ro/archlinux/$repo/os/$arch
#Server = https://mirror.efect.ro/archlinux/$repo/os/$arch
#Server = http://mirrors.go.ro/archlinux/$repo/os/$arch
#Server = https://mirrors.go.ro/archlinux/$repo/os/$arch
#Server = http://mirrors.hostico.ro/archlinux/$repo/os/$arch
#Server = https://mirrors.hostico.ro/archlinux/$repo/os/$arch
#Server = http://archlinux.mirrors.linux.ro/$repo/os/$arch
#Server = http://mirrors.m247.ro/archlinux/$repo/os/$arch
#Server = http://mirrors.nav.ro/archlinux/$repo/os/$arch
#Server = http://mirrors.nxthost.com/archlinux/$repo/os/$arch
#Server = https://mirrors.nxthost.com/archlinux/$repo/os/$arch
#Server = http://mirrors.pidginhost.com/arch/$repo/os/$arch
#Server = https://mirrors.pidginhost.com/arch/$repo/os/$arch
"""
Russia1="""#Server = http://mirror.surf/archlinux/$repo/os/$arch
#Server = https://mirror.surf/archlinux/$repo/os/$arch
#Server = http://mirror.nw-sys.ru/archlinux/$repo/os/$arch
#Server = https://mirror.nw-sys.ru/archlinux/$repo/os/$arch
#Server = http://mirrors.powernet.com.ru/archlinux/$repo/os/$arch
#Server = http://mirror.rol.ru/archlinux/$repo/os/$arch
#Server = https://mirror.rol.ru/archlinux/$repo/os/$arch
#Server = http://mirror.truenetwork.ru/archlinux/$repo/os/$arch
#Server = https://mirror.truenetwork.ru/archlinux/$repo/os/$arch
#Server = http://mirror.yandex.ru/archlinux/$repo/os/$arch
#Server = https://mirror.yandex.ru/archlinux/$repo/os/$arch
#Server = http://archlinux.zepto.cloud/$repo/os/$arch
"""
Reunion1="""
#Server = http://arch.mithril.re/$repo/os/$arch
"""
Serbia1="""
#Server = http://arch.petarmaric.com/$repo/os/$arch
#Server = http://mirror.pmf.kg.ac.rs/archlinux/$repo/os/$arch
"""
Singapore1="""
#Server = http://mirror.0x.sg/archlinux/$repo/os/$arch
#Server = https://mirror.0x.sg/archlinux/$repo/os/$arch
#Server = http://mirror.aktkn.sg/archlinux/$repo/os/$arch
#Server = https://mirror.aktkn.sg/archlinux/$repo/os/$arch
#Server = https://download.nus.edu.sg/mirror/archlinux/$repo/os/$arch
#Server = http://mirror.guillaumea.fr/archlinux/$repo/os/$arch
#Server = https://mirror.guillaumea.fr/archlinux/$repo/os/$arch
#Server = http://mirror.jingk.ai/archlinux/$repo/os/$arch
#Server = https://mirror.jingk.ai/archlinux/$repo/os/$arch
#Server = http://mirror.nus.edu.sg/archlinux/$repo/os/$arch
"""
Slovakia1="""
#Server = http://mirror.lnx.sk/pub/linux/archlinux/$repo/os/$arch
#Server = https://mirror.lnx.sk/pub/linux/archlinux/$repo/os/$arch
#Server = http://tux.rainside.sk/archlinux/$repo/os/$arch
"""
Slovenia1="""
#Server = http://archimonde.ts.si/archlinux/$repo/os/$arch
#Server = https://archimonde.ts.si/archlinux/$repo/os/$arch
"""
SouthAfrica1="""
#Server = http://archlinux.za.mirror.allworldit.com/archlinux/$repo/os/$arch
#Server = https://archlinux.za.mirror.allworldit.com/archlinux/$repo/os/$arch
#Server = http://za.mirror.archlinux-br.org/$repo/os/$arch
#Server = http://mirror.is.co.za/mirror/archlinux.org/$repo/os/$arch
#Server = http://opnmirror.co.za/archlinux/$repo/os/$arch
#Server = https://opnmirror.co.za/archlinux/$repo/os/$arch
#Server = http://mirrors.urbanwave.co.za/archlinux/$repo/os/$arch
#Server = https://mirrors.urbanwave.co.za/archlinux/$repo/os/$arch
"""
SouthKorea1="""
#Server = http://mirror.anigil.com/archlinux/$repo/os/$arch
#Server = https://mirror.anigil.com/archlinux/$repo/os/$arch
#Server = http://ftp.harukasan.org/archlinux/$repo/os/$arch
#Server = https://ftp.harukasan.org/archlinux/$repo/os/$arch
#Server = http://ftp.lanet.kr/pub/archlinux/$repo/os/$arch
#Server = https://ftp.lanet.kr/pub/archlinux/$repo/os/$arch
#Server = http://mirror.premi.st/archlinux/$repo/os/$arch
#Server = https://mirror.premi.st/archlinux/$repo/os/$arch
"""
Spain1="""
#Server = https://mirror.cloroformo.org/archlinux/$repo/os/$arch
#Server = http://mirror.librelabucm.org/archlinux/$repo/os/$arch
#Server = https://mirror.librelabucm.org/archlinux/$repo/os/$arch
#Server = http://ftp.rediris.es/mirror/archlinux/$repo/os/$arch
#Server = http://sharing.thelinuxsect.com/archlinux/$repo/os/$arch
"""
Sweden1="""
#Server = http://ftp.acc.umu.se/mirror/archlinux/$repo/os/$arch
#Server = https://ftp.acc.umu.se/mirror/archlinux/$repo/os/$arch
#Server = http://ftpmirror.infania.net/mirror/archlinux/$repo/os/$arch
#Server = https://ftp.ludd.ltu.se/mirrors/archlinux/$repo/os/$arch
#Server = http://ftp.lysator.liu.se/pub/archlinux/$repo/os/$arch
#Server = https://ftp.lysator.liu.se/pub/archlinux/$repo/os/$arch
#Server = http://ftp.myrveln.se/pub/linux/archlinux/$repo/os/$arch
#Server = https://ftp.myrveln.se/pub/linux/archlinux/$repo/os/$arch
#Server = https://mirror.osbeck.com/archlinux/$repo/os/$arch
#Server = http://tedwall.se/archlinux/$repo/os/$arch
#Server = https://tedwall.se/archlinux/$repo/os/$arch
"""
Switzerland1="""
#Server = http://pkg.adfinis.com/archlinux/$repo/os/$arch
#Server = https://pkg.adfinis.com/archlinux/$repo/os/$arch
#Server = http://mirror.init7.net/archlinux/$repo/os/$arch
#Server = https://mirror.init7.net/archlinux/$repo/os/$arch
#Server = http://mirror.puzzle.ch/archlinux/$repo/os/$arch
#Server = https://mirror.puzzle.ch/archlinux/$repo/os/$arch
#Server = https://theswissbay.ch/archlinux/$repo/os/$arch
#Server = https://mirror.ungleich.ch/mirror/packages/archlinux/$repo/os/$arch
"""
Taiwan1="""
#Server = http://archlinux.ccns.ncku.edu.tw/archlinux/$repo/os/$arch
#Server = http://free.nchc.org.tw/arch/$repo/os/$arch
#Server = https://free.nchc.org.tw/arch/$repo/os/$arch
#Server = http://archlinux.cs.nctu.edu.tw/$repo/os/$arch
#Server = http://shadow.ind.ntou.edu.tw/archlinux/$repo/os/$arch
#Server = https://shadow.ind.ntou.edu.tw/archlinux/$repo/os/$arch
#Server = http://ftp.tku.edu.tw/Linux/ArchLinux/$repo/os/$arch
#Server = http://ftp.yzu.edu.tw/Linux/archlinux/$repo/os/$arch
#Server = https://ftp.yzu.edu.tw/Linux/archlinux/$repo/os/$arch
"""
Thailand1="""
#Server = https://mirror.cyberbits.asia/archlinux/$repo/os/$arch
#Server = http://mirror.kku.ac.th/archlinux/$repo/os/$arch
#Server = https://mirror.kku.ac.th/archlinux/$repo/os/$arch
#Server = http://mirror2.totbb.net/archlinux/$repo/os/$arch
"""
Turkey1="""
#Server = http://ftp.linux.org.tr/archlinux/$repo/os/$arch
#Server = http://mirror.veriteknik.net.tr/archlinux/$repo/os/$arch
"""
Ukraine1="""
#Server = http://archlinux.astra.in.ua/$repo/os/$arch
#Server = https://archlinux.astra.in.ua/$repo/os/$arch
#Server = http://repo.endpoint.ml/archlinux/$repo/os/$arch
#Server = https://repo.endpoint.ml/archlinux/$repo/os/$arch
#Server = http://archlinux.ip-connect.vn.ua/$repo/os/$arch
#Server = https://archlinux.ip-connect.vn.ua/$repo/os/$arch
#Server = http://mirror.mirohost.net/archlinux/$repo/os/$arch
#Server = https://mirror.mirohost.net/archlinux/$repo/os/$arch
#Server = http://mirrors.nix.org.ua/linux/archlinux/$repo/os/$arch
#Server = https://mirrors.nix.org.ua/linux/archlinux/$repo/os/$arch
"""
UnitedKingdom1="""
#Server = http://archlinux.uk.mirror.allworldit.com/archlinux/$repo/os/$arch
#Server = https://archlinux.uk.mirror.allworldit.com/archlinux/$repo/os/$arch
#Server = http://mirror.bytemark.co.uk/archlinux/$repo/os/$arch
#Server = https://mirror.bytemark.co.uk/archlinux/$repo/os/$arch
#Server = http://mirrors.gethosted.online/archlinux/$repo/os/$arch
#Server = https://mirrors.gethosted.online/archlinux/$repo/os/$arch
#Server = http://mirrors.manchester.m247.com/arch-linux/$repo/os/$arch
#Server = http://mirrors.melbourne.co.uk/archlinux/$repo/os/$arch
#Server = https://mirrors.melbourne.co.uk/archlinux/$repo/os/$arch
#Server = http://www.mirrorservice.org/sites/ftp.archlinux.org/$repo/os/$arch
#Server = https://www.mirrorservice.org/sites/ftp.archlinux.org/$repo/os/$arch
#Server = http://mirror.netweaver.uk/archlinux/$repo/os/$arch
#Server = https://mirror.netweaver.uk/archlinux/$repo/os/$arch
#Server = http://lon.mirror.rackspace.com/archlinux/$repo/os/$arch
#Server = https://lon.mirror.rackspace.com/archlinux/$repo/os/$arch
#Server = http://arch.serverspace.co.uk/arch/$repo/os/$arch
#Server = http://mirrors.ukfast.co.uk/sites/archlinux.org/$repo/os/$arch
#Server = https://mirrors.ukfast.co.uk/sites/archlinux.org/$repo/os/$arch
#Server = http://mirror.cov.ukservers.com/archlinux/$repo/os/$arch
#Server = https://mirror.cov.ukservers.com/archlinux/$repo/os/$arch
"""
UnitedStates1="""
#Server = http://mirrors.acm.wpi.edu/archlinux/$repo/os/$arch
#Server = http://mirrors.advancedhosters.com/archlinux/$repo/os/$arch
#Server = http://mirrors.aggregate.org/archlinux/$repo/os/$arch
#Server = https://america.mirror.pkgbuild.com/$repo/os/$arch
#Server = http://ca.us.mirror.archlinux-br.org/$repo/os/$arch
#Server = http://il.us.mirror.archlinux-br.org/$repo/os/$arch
#Server = http://mirror.arizona.edu/archlinux/$repo/os/$arch
#Server = https://mirror.arizona.edu/archlinux/$repo/os/$arch
#Server = http://arlm.tyzoid.com/$repo/os/$arch
#Server = https://arlm.tyzoid.com/$repo/os/$arch
#Server = https://mirror.ava.dev/archlinux/$repo/os/$arch
#Server = http://mirrors.cat.pdx.edu/archlinux/$repo/os/$arch
#Server = http://mirror.cc.columbia.edu/pub/linux/archlinux/$repo/os/$arch
#Server = http://mirror.clarkson.edu/archlinux/$repo/os/$arch
#Server = https://mirror.clarkson.edu/archlinux/$repo/os/$arch
#Server = http://arch.mirror.constant.com/$repo/os/$arch
#Server = https://arch.mirror.constant.com/$repo/os/$arch
#Server = http://mirror.cs.pitt.edu/archlinux/$repo/os/$arch
#Server = http://mirror.cs.vt.edu/pub/ArchLinux/$repo/os/$arch
#Server = http://mirror.cybersecurity.nmt.edu/archlinux/$repo/os/$arch
#Server = https://mirror.cybersecurity.nmt.edu/archlinux/$repo/os/$arch
#Server = http://distro.ibiblio.org/archlinux/$repo/os/$arch
#Server = http://mirror.es.its.nyu.edu/archlinux/$repo/os/$arch
#Server = http://mirror.ette.biz/archlinux/$repo/os/$arch
#Server = https://mirror.ette.biz/archlinux/$repo/os/$arch
#Server = http://mirrors.gigenet.com/archlinux/$repo/os/$arch
#Server = http://www.gtlib.gatech.edu/pub/archlinux/$repo/os/$arch
#Server = http://mirror.hackingand.coffee/arch/$repo/os/$arch
#Server = https://mirror.hackingand.coffee/arch/$repo/os/$arch
#Server = https://mirror.hodgepodge.dev/archlinux/$repo/os/$arch
#Server = http://mirror.hostup.org/archlinux/$repo/os/$arch
#Server = https://mirror.hostup.org/archlinux/$repo/os/$arch
#Server = http://arch.hu.fo/archlinux/$repo/os/$arch
#Server = https://arch.hu.fo/archlinux/$repo/os/$arch
#Server = http://repo.ialab.dsu.edu/archlinux/$repo/os/$arch
#Server = https://repo.ialab.dsu.edu/archlinux/$repo/os/$arch
#Server = http://mirrors.kernel.org/archlinux/$repo/os/$arch
#Server = https://mirrors.kernel.org/archlinux/$repo/os/$arch
#Server = http://mirror.dal10.us.leaseweb.net/archlinux/$repo/os/$arch
#Server = http://mirror.mia11.us.leaseweb.net/archlinux/$repo/os/$arch
#Server = http://mirror.sfo12.us.leaseweb.net/archlinux/$repo/os/$arch
#Server = http://mirror.wdc1.us.leaseweb.net/archlinux/$repo/os/$arch
#Server = https://mirror.dal10.us.leaseweb.net/archlinux/$repo/os/$arch
#Server = https://mirror.mia11.us.leaseweb.net/archlinux/$repo/os/$arch
#Server = https://mirror.sfo12.us.leaseweb.net/archlinux/$repo/os/$arch
#Server = https://mirror.wdc1.us.leaseweb.net/archlinux/$repo/os/$arch
#Server = http://mirrors.liquidweb.com/archlinux/$repo/os/$arch
#Server = http://mirror.lty.me/archlinux/$repo/os/$arch
#Server = https://mirror.lty.me/archlinux/$repo/os/$arch
#Server = http://mirrors.lug.mtu.edu/archlinux/$repo/os/$arch
#Server = https://mirrors.lug.mtu.edu/archlinux/$repo/os/$arch
#Server = http://mirror.math.princeton.edu/pub/archlinux/$repo/os/$arch
#Server = http://mirror.metrocast.net/archlinux/$repo/os/$arch
#Server = http://mirror.kaminski.io/archlinux/$repo/os/$arch
#Server = https://mirror.kaminski.io/archlinux/$repo/os/$arch
#Server = http://iad.mirrors.misaka.one/archlinux/$repo/os/$arch
#Server = https://iad.mirrors.misaka.one/archlinux/$repo/os/$arch
#Server = http://repo.miserver.it.umich.edu/archlinux/$repo/os/$arch
#Server = http://mirrors.mit.edu/archlinux/$repo/os/$arch
#Server = https://mirrors.mit.edu/archlinux/$repo/os/$arch
#Server = http://mirrors.ocf.berkeley.edu/archlinux/$repo/os/$arch
#Server = https://mirrors.ocf.berkeley.edu/archlinux/$repo/os/$arch
#Server = http://archmirror1.octyl.net/$repo/os/$arch
#Server = https://archmirror1.octyl.net/$repo/os/$arch
#Server = http://ftp.osuosl.org/pub/archlinux/$repo/os/$arch
#Server = http://arch.mirrors.pair.com/$repo/os/$arch
#Server = http://dfw.mirror.rackspace.com/archlinux/$repo/os/$arch
#Server = http://iad.mirror.rackspace.com/archlinux/$repo/os/$arch
#Server = http://ord.mirror.rackspace.com/archlinux/$repo/os/$arch
#Server = https://dfw.mirror.rackspace.com/archlinux/$repo/os/$arch
#Server = https://iad.mirror.rackspace.com/archlinux/$repo/os/$arch
#Server = https://ord.mirror.rackspace.com/archlinux/$repo/os/$arch
#Server = http://mirrors.radwebhosting.com/archlinux/$repo/os/$arch
#Server = https://mirrors.radwebhosting.com/archlinux/$repo/os/$arch
#Server = http://plug-mirror.rcac.purdue.edu/archlinux/$repo/os/$arch
#Server = https://plug-mirror.rcac.purdue.edu/archlinux/$repo/os/$arch
#Server = http://mirrors.rit.edu/archlinux/$repo/os/$arch
#Server = https://mirrors.rit.edu/archlinux/$repo/os/$arch
#Server = http://mirrors.rutgers.edu/archlinux/$repo/os/$arch
#Server = https://mirrors.rutgers.edu/archlinux/$repo/os/$arch
#Server = http://mirror.siena.edu/archlinux/$repo/os/$arch
#Server = http://mirrors.sonic.net/archlinux/$repo/os/$arch
#Server = https://mirrors.sonic.net/archlinux/$repo/os/$arch
#Server = http://mirror.phx1.us.spryservers.net/archlinux/$repo/os/$arch
#Server = https://mirror.phx1.us.spryservers.net/archlinux/$repo/os/$arch
#Server = http://arch.mirror.square-r00t.net/$repo/os/$arch
#Server = https://arch.mirror.square-r00t.net/$repo/os/$arch
#Server = http://mirror.stephen304.com/archlinux/$repo/os/$arch
#Server = https://mirror.stephen304.com/archlinux/$repo/os/$arch
#Server = http://ftp.sudhip.com/archlinux/$repo/os/$arch
#Server = https://ftp.sudhip.com/archlinux/$repo/os/$arch
#Server = http://mirror.pit.teraswitch.com/archlinux/$repo/os/$arch
#Server = https://mirror.pit.teraswitch.com/archlinux/$repo/os/$arch
#Server = https://mirror.theash.xyz/arch/$repo/os/$arch
#Server = http://mirror.umd.edu/archlinux/$repo/os/$arch
#Server = http://mirror.vtti.vt.edu/archlinux/$repo/os/$arch
#Server = http://mirrors.xmission.com/archlinux/$repo/os/$arch
#Server = http://mirrors.xtom.com/archlinux/$repo/os/$arch
#Server = https://mirrors.xtom.com/archlinux/$repo/os/$arch
#Server = https://zxcvfdsa.com/arch/$repo/os/$arch
"""
Vietnam1="""
#Server = http://f.archlinuxvn.org/archlinux/$repo/os/$arch
#Server = http://mirror.bizflycloud.vn/archlinux/$repo/os/$arch
"""












    


# next def is evoked by process button
def button_clicked():
    var.set('ok working on it ')
    res = requests.get('https://archlinux.org/mirrorlist/all/')
    t=selected.get()
   
#choice 1 populate mirrorlist none enabled    
    if t =="1":
        
        myvar= res.text
        file = open('/etc/pacman.d/mirrorlist' , 'w')
        file.write(myvar)
        file.close()
        var.set("done ")
#choice 2 populate and enable all        
    elif t =='2':
        
         myvar= res.text
         newvar = re.sub(r'[#](?!#)', " ", myvar)
         file = open('/etc/pacman.d/mirrorlist' , 'w')
         file.write(newvar)
         file.close()
         var.set("done ")   
    
    elif t=='3':
             
        d= countries.get()
        if d=="select nearest Country":
             var.set("please also choose a country from drop down")
        
        elif d=="Worldwide":
            t=countryMirrors(Worldwide1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        elif d=="Australia":
            t=countryMirrors(Australia1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        elif d=="Austria":
            t=countryMirrors(Austria1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        elif d=="Bangladesh":
            t=countryMirrors('Bangladesh1')
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        elif d=="Belarus":
            t=countryMirrors(Belarus1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        elif d=="Belgium":
            t=countryMirrors(Belgium1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        
        elif d=="BosniaNHezegovia":
            t=countryMirrors(BosniaNHerzegovina1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        elif d=="Brazil":
            t=countryMirrors(Brazil1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist")           
                    
        elif d=="Bulgaria":
            t=countryMirrors(Bulgaria1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
                 
                    
        elif d=="Cambodia":
            t=countryMirrors(Cambodia1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
                  
                    
        elif d=="Canada":
            t=countryMirrors(Canada1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        elif d=="Chile":
            t=countryMirrors(Chile1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        elif d=="China":
            t=countryMirrors(China1)
            if t =="done":
                       var.set("done written to /etc/pacman.d/mirrorlist") 
           
        elif d=="Croatia":
            t=countryMirrors(Croatia1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        elif d=="Czechia":
            t=countryMirrors(Czechia1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
         
        elif d=="Denmark":
            t=countryMirrors(Denmark1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist")  
        
        elif d=="Ecuador":
            t=countryMirrors(Ecuador1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist")   
        elif d=="Estonia":
            t=countryMirrors(Estonia1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist")   
        elif d=="Finland":
            t=countryMirrors(Finland1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist")   
         
        
        
        elif d=="France":
            t=countryMirrors(France1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist")   
         
        
        
        elif d=="Georgia":
            t=countryMirrors(Georgia1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist")   
        
        
        elif d=="Germany":
            t=countryMirrors(Germany1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist")   
        
        
        elif d=="Greece":
            t=countryMirrors(Greece1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist")   
         
        elif d=="HongKong":
            t=countryMirrors(HongKong1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist")   
          
        elif d=="Hungary":
            t=countryMirrors(Hungary1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist")   
                    
        elif d=="Iceland":
            t=countryMirrors(Iceland1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist")               
        
        
        
        elif d=="India":
            t=countryMirrors(India1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        
        elif d=="Indonesia":
            t=countryMirrors(Indonesia1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        
        
        elif d=="Iran":
            t=countryMirrors(Iran1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        elif d=="Ireland":
            t=countryMirrors(Ireland1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
         
         
        elif d=="Israel":
            t=countryMirrors(Israel1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
         
         
        elif d=="Italy":
            t=countryMirrors(Italy1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
       
       
        elif d=="Japan":
            t=countryMirrors(Japan1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
       
        
        elif d=="Kazakhstan":
            t=countryMirrors(Kazakhstan1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        
        elif d=="Kenya":
            t=countryMirrors(Kenya1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        elif d=="Latvia":
            t=countryMirrors(Latvia1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        
        elif d=="Lithuania":
            t=countryMirrors(Lithuania1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        
        
        elif d=="Luxembourg":
            t=countryMirrors(Luxembourg1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        
        elif d=="Mexico":
            t=countryMirrors(Mexico1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        
        elif d=="Moldova":
            t=countryMirrors(Moldova1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        
        elif d=="Netherlands":
            t=countryMirrors(Netherlands1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        
        elif d=="NewCaledonia":
            t=countryMirrors(NewCaledonia1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        
        
        elif d=="NewZealand":
            t=countryMirrors(NewZealand1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        elif d=="North Macedonia":
            t=countryMirrors(NorthMacedonia1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        
        elif d=="Norway":
            t=countryMirrors(Norway1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        
        
        
        elif d=="Pakistan":
            t=countryMirrors(Pakistan1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        
        
        elif d=="Paraguay":
            t=countryMirrors(Paraguay1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
        
        elif d=="Poland":
            t=countryMirrors(Poland1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
       
        elif d=="Portugal":
            t=countryMirrors(Portugal1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
       
        elif d=="Romania":
            t=countryMirrors(Romania1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
       
        elif d=="'Russia":
            t=countryMirrors(Russia1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
       
       
        elif d=="Reunion":
            t=countryMirrors(Reunion1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
       
        elif d=="Serbia":
            t=countryMirrors(Serbia1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
       
       
        elif d=="Singapore":
            t=countryMirrors(Singapore1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        
       
       
        elif d=="Slovakia":
            t=countryMirrors(Slovakia1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        elif d=="Slovenia":
            t=countryMirrors(Slovenia1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
         
       
        elif d=="South Africa":
            t=countryMirrors(SouthAfrica1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        elif d=="South Korea":
            t=countryMirrors(SouthKorea1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist")  
        elif d=="Spain":
            t=countryMirrors(Spain1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        elif d=="Sweden":
            t=countryMirrors(Sweden1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
       
     
       
        elif d=="Switzerland":
            t=countryMirrors(Switzerland1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
       
       
       
       
        elif d=="Taiwan":
            t=countryMirrors(Taiwan1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
        elif d=="Switzerland":
            t=countryMirrors(Switzerland1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
       
       
        elif d=="Thailand":
            t=countryMirrors(Thailand1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
       
       
        elif d=="Turkey":
            t=countryMirrors(Turkey1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
       
       
        elif d=="Ukraine":
            t=countryMirrors(Ukraine1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
       
       
        elif d=="United Kingdom":
            t=countryMirrors(UnitedKingdom1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
       
       
        elif d=="USA":
            t=countryMirrors(UnitedStates1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
       
       
        elif d=="Vietnam":
            t=countryMirrors(Vietnam1)
            if t =="done":
                    var.set("done written to /etc/pacman.d/mirrorlist") 
       
       
        else:
           
                 print ("i have no clue what you picked")
                 
    
               
            
               
           # here do all filtering of string get time elapsed and write to /etc/pacman.d/mirrors




    
    
def countryMirrors(someVar):
	# here could put all processing 
    stringOfMirrorsNoHash = ""    
    myDic= {}
    stringOfMirrorsNoHash = re.sub(r'[#](?!#)', " ", someVar)
    stringOfMirrorsNoHash2 = re.sub(r'(Server\s=)', "",   stringOfMirrorsNoHash ) 
   
    print(stringOfMirrorsNoHash2)
    
    lines =         stringOfMirrorsNoHash2.splitlines()
    for t in lines:
       try:
             times=(requests.get(t,timeout=3).elapsed.total_seconds())
             myDic[t]=times 
             
       except:
                print ("there is a problem")	
    
    
    print(myDic)
    sort_dict= dict(sorted(myDic.items(), key=operator.itemgetter(1))) 
    print("Sorted Dictionary by value: ", sort_dict)
    file2 = open('/etc/pacman.d/mirrorlist','w')
    
    for k, v in sort_dict.items():
        print(k)
        try:
            file2.write('Server = '+ k+'\n')
        except:
            print("a problem occured")

    file2.close()
    process="done"
    return process   
    
    
def radio_selected():
	t= selected.get()
	print(t)	   
	var.set("waiting")
 
 
def testButtonClicked():
    print('test button cloicked')
    var.set("ok working on it")
   
def countryPicked(event):
	d=countries.get()
	print(d)   
	var.set(' waiting for process button to be clicked')
def _quit():
    root.quit()     
    root.destroy()
    
""" root """   
root = tk.Tk()
root.geometry('500x420')
root.resizable(True,True)
root.title('fetchMirrorsGui')
root.columnconfigure(0,weight=3)
root.columnconfigure(1,weight=1)
root.columnconfigure(2,weight=1)
root.rowconfigure(0,weight=1)
root.rowconfigure(1,weight=1)
root.rowconfigure(2,weight=1)
root.rowconfigure(3,weight=1)
root.rowconfigure(4,weight =1)
root.rowconfigure(5,weight =1)
root.configure(background='LemonChiffon2')
root.option_add("*background", "PaleGoldenrod"),
root.option_add("*foreground", "purple"),




""" style  """


style= ttk.Style()
style.configure('TButton',foreground=[("black")],background=["LightGoldenrod1"])
style.map('TButton', foreground=[('hover', 'black')], background=[('hover', 'LimeGreen')])
style.configure("TCombobox", foreground= "purple", activebackground= "purple",  font=('Helvetica', 14))
style.map('TCombobox', foreground=[('pressed', 'red'), ('active', 'blue')])
style.map('TCombobox', foreground=[('hover', 'red')], background=[('hover', 'yellow')])

style.configure('TCheckbutton',foreground=[("black")],background=["brown"])
style.map('TCheckbutton', foreground=[('hover', 'black')], background=[('hover', 'yellow')])



HighlightFont = font.Font(family='Times', size=12, weight='bold')



topLable = ttk.Label(root, text =""" Radio button 1 for whole mirror list (needs editing to enable) \n
 Radio 2 same but all enabled and .... \n for your Country (or nearest) \n
  click radio button 3 first ..then select a Country from drop down list  \n 
  Then as in all 3  cases click  button to process  """, background='ivory',foreground ="black" , font=HighlightFont)
topLable.grid(column=0,row= 0,columnspan=3)


"""label  next yellow button """

var = tk.StringVar()
var.set('waiting to process')
""" radio 1 label """

l = ttk.Label(root, text ="populate mirror list  and do manual edit to \n activate mirror  you want  (1) -> ", background='LemonChiffon',foreground ="black" )
l.grid(column=0,row=1)

""" radio 1"""
selected = tk.StringVar()
selected.set('2')


""" radio 2 label """

label = ttk.Label(root, text="populate and have all mirrors enabled (2)->", background='LemonChiffon', foreground='black')
label.grid(column=0,row=2)

inform = ttk.Label(root, textvariable =var , background='gray84', foreground='black')
inform.grid(column=0,row=4)



""" radio buttons """
r = ttk.Radiobutton(root,text='1', value='1', variable=selected,command=radio_selected)
r.grid(column=1, row=1 )
s = ttk.Radiobutton(root,text='2', value='2', variable=selected,command=radio_selected)
s.grid(column=1,row=2)
t=  ttk.Radiobutton(root,text='3', value='3', variable=selected,command=radio_selected)
t.grid(column=1, row=3)


"""process button"""

Button1 = ttk.Button(root, text='Process  Above Selection',command=button_clicked)
Button1.grid(column=0,row=5,columnspan=2)







"""  country combobox """


    
countryVar = tk.StringVar()
countries =ttk.Combobox(root, textvariable= countryVar)
countryVar.set("select nearest Country")
countries.grid(column= 0, row =3) 
countries['values']= ('Worldwide','Australia','Austria','Bangladesh' ,'Belarus','Belgium','BosniaNHezegovia',\
 'Brazil', 'Bulgaria', 'Combodia','Canada','Chile','China','Colombia','Croatia','Czechia','Denmark','Ecuador',\
 'Estonia','Finland','France','Georgia','Germany','Greece','HongKong','Hungary','Iceland','India','Indonesia','iran','Ireland',\
 'Israel','Italy','Japan','Kazakhstan', 'Kenya', 'Latvia','Lithuania','Luxembourg','Mexico', 'Moldova','Netherlands','NewCaledonia',\
 'NewZealand','North Macedonia','Norway','Pakistan','Paraguay','Poland','Portugal','Romania','Russia','Reunion','Serbia',\
 'Singapore','Slovakia','Slovenia','South Africa','South Korea','Spain','Sweden','Switzerland','Taiwan'\
 'Thailand','Turkey','Ukraine','United Kingdom','USA','Vietnam' )





countries.bind('<<ComboboxSelected>>',countryPicked)


""" testButton 

testButton = ttk.Button(root, text='test event button', command=lambda: button_clicked())
testButton.grid(column=1,row=4)

"""


""" green exit button """

exit_button = ttk.Button(root, text="Exit", command=_quit)
exit_button.grid(column=2,row=5)







root.mainloop()
