diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a7c4ca9f46fc790dc6670e850e019ec5d7b6f91..9a4a864081f64adf8483619c41b1a9e3ea48e670 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,10 @@ All notable changes to this project will be documented in this file. ## [4.0.4-dev] -- improvement on `--interactive`: select mirrors by protocol -- added to config `# SSL = False` +- Improvement on `--interactive`: select mirrors by protocol. +- Added to config `# SSL = False`. +- Some optimizations. +- Update translations. ## [4.0.3] - 2017-03-28 - Fix issue with `--fasttrack` and `OnlyCountry = Custom`. diff --git a/Makefile b/Makefile index 7649a985b41db1e6a0da37af8a7bcef33907b73e..beb8115604228115b1caf03cb74e5cd4ee0c5903 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ help: @echo "test - run tests quickly with the default Python" @echo "test-all - run tests on every Python version with tox" @echo "coverage - check code coverage quickly with the default Python" - @echo "docs - generate Sphinx HTML documentation, including API docs" + @echo "docs - generate MkDocs HTML documentation, including API docs" @echo "release - package and upload a release" @echo "dist - package" @echo "install - install the package to the active Python's site-packages" diff --git a/README.md b/README.md index a3efbbb7be8d63bcc68acd0e86587a18bab2103c..308c3ca50138364241a1e2f322addf3fff966259 100644 --- a/README.md +++ b/README.md @@ -17,27 +17,31 @@ Package that provides all mirrors for Manjaro Linux. - A GUI for selecting the mirrors to used to generate a custom list. ### How does fasttrack work -First of all, a working internet connection is mandatory. Pacman-Mirrors always checks if network is online. It is doing so by pinging google with 3 packets. +First of all, a working internet connection is mandatory. pacman-mirrors always checks if network is online. It is doing so by pinging google with 3 packets. -The following arguments `-c -i -m --geoip` will not work in conjunction with `-f`. +The following arguments `-c -i -m --geoip` will not work in conjunction with `-f`. #### Question: So, `pacman-mirrors -f 2` takes the same time to create `/etc/pacman.d/mirrorlist` as `pacman-mirrors -f 20`? ##### Answer: No. `pacman-mirors -f 2` will be faster than `pacman-mirrors -f 20` since only 2 mirrors are probed vs 20 mirrors but since most mirrors respond within the first second it is barely noticeable. #### Question: `pacman-mirrors -f n` always ranks ALL mirrors by response time (the same as `pacman-mirrors -g` does) and additionally takes up-to-date mirrors and writes only **n** mirrors to `/etc/pacman.d/mirrorlist`? -##### Answer: -No. `pacman-mirrors -f n` ranks on a sorted list with known up-to-date mirrors. Thus it is only the first **n** mirrors from this list which are actually probed. If you have a list of 30 mirrors which are uptodate and use `-f 5` only the top 5 mirrors are probed and then sorted after response time. -The switch does not guarantee you get **the n** fastest mirrors only that they are responsive and uptodate. Mirrors which have network errors or times out are not considered at all. +##### Answer: +No. `pacman-mirrors -f n` ranks on a sorted list with known up-to-date mirrors. Thus it is only the first **n** mirrors from this list which are actually probed. If you have a list of 30 mirrors which are up-to-date and use `-f 5` only the top 5 mirrors are probed and then sorted after response time. +The switch does not guarantee you get **the n** fastest mirrors only that they are responsive and up-to-date. Mirrors which have network errors or times out are not considered at all. #### Beware The smaller number you choose to write to the mirrorlist will increase the possibility of not getting a responsive mirror since only the first **n** in the list are tested not all of them. A reasonable number is between 5 and 10. -The force of this approach is that we know forehand if the mirror is uptodate and thus only have to rank **n** mirrors from the mirrors known to be uptodate. +The force of this approach is that we know forehand if the mirror is up-to-date and thus only have to rank **n** mirrors from the mirrors known to be up-to-date. If you need a complete ranking then `pacman-mirrors -g` is the way to go. ## Technologies -pacman-mirrors is build with Python and Gtk3. +pacman-mirrors uses open-source projects to work properly: + +* [Python 3](https://www.python.org) +* [GTK+ 3](https://www.gtk.org) +* [npyscreen](https://github.com/npcole/npyscreen) diff --git a/locale/tr/LC_MESSAGES/pacman_mirrors.po b/locale/tr/LC_MESSAGES/pacman_mirrors.po index 987503ed4f2c4e53ab2cc31688fe733d6782a0b6..95aa55910be51891186f1a11f22c4b873b2913bd 100644 --- a/locale/tr/LC_MESSAGES/pacman_mirrors.po +++ b/locale/tr/LC_MESSAGES/pacman_mirrors.po @@ -5,14 +5,16 @@ # # Translators: # Ali Kömesöğütlü <byzlo685@gmail.com>, 2017 +# Demiray Muhterem <mdemiray@msn.com>, 2017 +# ilkeryus <ilkeryus@gmail.com>, 2016 # ilkeryus <ilkeryus@gmail.com>, 2016 msgid "" msgstr "" "Project-Id-Version: manjaro-pacman-mirrors\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2017-02-20 15:44+0100\n" -"PO-Revision-Date: 2017-03-06 15:24+0000\n" -"Last-Translator: Ali Kömesöğütlü <byzlo685@gmail.com>\n" +"PO-Revision-Date: 2017-03-30 19:10+0000\n" +"Last-Translator: Demiray Muhterem <mdemiray@msn.com>\n" "Language-Team: Turkish (http://www.transifex.com/manjarolinux/manjaro-pacman-mirrors/language/tr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -39,7 +41,7 @@ msgstr "Zaman aşımı" #: pacman_mirrors/txt.py:36 msgid "HTTPException" -msgstr "" +msgstr "HTTPHariç" #: pacman_mirrors/txt.py:38 msgid "PATH" @@ -55,115 +57,115 @@ msgstr "SANİYE" #: pacman_mirrors/txt.py:41 msgid "DIGIT" -msgstr "" +msgstr "RAKAM" #: pacman_mirrors/txt.py:43 msgid "Branch name" -msgstr "" +msgstr "Kol adı" #: pacman_mirrors/txt.py:44 msgid "Comma separated list of countries, from which mirrors will be used" -msgstr "" +msgstr "Yansıların kullanılacağı, virgülle ayrılmış ülkelerin listesi" #: pacman_mirrors/txt.py:46 msgid "Output file" -msgstr "" +msgstr "Çıktı dosyası" #: pacman_mirrors/txt.py:47 msgid "Generate mirrorlist" -msgstr "" +msgstr "Yansı listesi oluştur" #: pacman_mirrors/txt.py:48 msgid "Get current country using geolocation. Ignored if" -msgstr "" +msgstr "Coğrafi konum kullanarak ülkenizi öğrenin. Yok sayarsan" #: pacman_mirrors/txt.py:49 msgid "is supplied" -msgstr "" +msgstr "tedarik edildi" #: pacman_mirrors/txt.py:50 msgid "Generate custom mirrorlist" -msgstr "" +msgstr "Özel yansı listesi oluştur" #: pacman_mirrors/txt.py:51 msgid "Generation method" -msgstr "" +msgstr "Oluşturma yöntemi" #: pacman_mirrors/txt.py:52 msgid "Don't generate mirrorlist if" -msgstr "" +msgstr "Eğer var ise yansı listesi oluşturmayın" #: pacman_mirrors/txt.py:53 msgid "in the configuration file" -msgstr "" +msgstr "yapılandırma dosyasında" #: pacman_mirrors/txt.py:54 msgid "Mirrors list path" -msgstr "" +msgstr "yansı listesi yolu" #: pacman_mirrors/txt.py:55 msgid "Quiet mode - less verbose output" -msgstr "" +msgstr "Sessiz mod - daha detaysız çıktı" #: pacman_mirrors/txt.py:56 msgid "Maximum waiting time for server response" -msgstr "" +msgstr "Sunucu yanıtı için azami bekleme süresi" #: pacman_mirrors/txt.py:57 msgid "Print the pacman-mirrors version" -msgstr "" +msgstr "pacman-mirrors sürümünü yazdır" #: pacman_mirrors/txt.py:58 msgid "A quick mirrorlist. Overrides -cim --geoip" -msgstr "" +msgstr "Hızlı bir yansı listesi. -cim --geoip'i geçersiz kılar" #: pacman_mirrors/txt.py:60 msgid "Available countries are" -msgstr "" +msgstr "Mevcut ülkeler" #: pacman_mirrors/txt.py:61 msgid "Could not download from" -msgstr "" +msgstr "Adresinden indirilemedi" #: pacman_mirrors/txt.py:62 msgid "Cannot read file" -msgstr "" +msgstr "Dosya okunamadı" #: pacman_mirrors/txt.py:63 msgid "Cannot write file" -msgstr "" +msgstr "Dosyaya yazılamadı" #: pacman_mirrors/txt.py:64 msgid "Converting custom mirror file to new format" -msgstr "" +msgstr "Özel yansı listesini yeni biçime dönüştür" #: pacman_mirrors/txt.py:65 msgid "Custom mirror file" -msgstr "" +msgstr "Özel yansı dosyası" #: pacman_mirrors/txt.py:66 msgid "Custom mirror file saved" -msgstr "" +msgstr "Özel yansı dpsyası kaydedildi" #: pacman_mirrors/txt.py:67 msgid "User generated mirror list" -msgstr "" +msgstr "Kullanıcı tarafından oluşturulan yansı listesi" #: pacman_mirrors/txt.py:68 msgid "doesn't exist." -msgstr "" +msgstr "varolmayan." #: pacman_mirrors/txt.py:69 msgid "Downloading mirrors from repo.manjaro.org" -msgstr "" +msgstr "Yansı listesi repo.manjaro.org adresinden indiriliyor" #: pacman_mirrors/txt.py:70 msgid "Falling back to" -msgstr "" +msgstr "Geri düşüm" #: pacman_mirrors/txt.py:71 msgid "is missing" -msgstr "" +msgstr "kayıp" #: pacman_mirrors/txt.py:72 msgid "The mirror file" @@ -171,19 +173,19 @@ msgstr "Yansı dosyası" #: pacman_mirrors/txt.py:73 msgid "Mirrorlist generated and saved to" -msgstr "" +msgstr "Yansı oluşturuldu ve kaydedildi" #: pacman_mirrors/txt.py:74 msgid "Must have root privileges" -msgstr "" +msgstr "Root yetkisine sahip olmalısınız" #: pacman_mirrors/txt.py:75 msgid "The mirror list is not changed" -msgstr "" +msgstr "Yansı listesi değiştirilmedi" #: pacman_mirrors/txt.py:76 msgid "No mirrors in selection" -msgstr "" +msgstr "Yansı seçilmedi" #: pacman_mirrors/txt.py:77 msgid "Option" @@ -191,51 +193,51 @@ msgstr "Seçenek" #: pacman_mirrors/txt.py:78 msgid "Writing mirror list" -msgstr "" +msgstr "Yansı listesi yazılıyor" #: pacman_mirrors/txt.py:79 msgid "Querying mirrors" -msgstr "" +msgstr "Yansı sorgulama" #: pacman_mirrors/txt.py:80 msgid "Randomizing mirror list" -msgstr "" +msgstr "Rastgele yansı listesi seç" #: pacman_mirrors/txt.py:81 msgid "To reset custom config run `pacman-mirrors -c all`" -msgstr "" +msgstr "Özel yansıları sıfırlamak için `pacman-mirrors -c all` kullanın" #: pacman_mirrors/txt.py:82 msgid "This may take some time" -msgstr "" +msgstr "Bu işlem biraz zaman alabilir" #: pacman_mirrors/txt.py:83 msgid "unknown country" -msgstr "" +msgstr "bilinmeyen ülke" #: pacman_mirrors/txt.py:84 msgid "Using all mirrors" -msgstr "" +msgstr "Tüm yansılar kullanılsın" #: pacman_mirrors/txt.py:85 msgid "Using custom mirror file" -msgstr "" +msgstr "Özel yansı dosyası kullanılsın" #: pacman_mirrors/txt.py:86 msgid "Using default mirror file" -msgstr "" +msgstr "Varsayılan yansı dosyası kullanılsın" #: pacman_mirrors/txt.py:88 msgid "Manjaro mirrors by response time" -msgstr "" +msgstr "Hızına göre yansılar kullanılsın" #: pacman_mirrors/txt.py:89 msgid "Manjaro mirrors in random order" -msgstr "" +msgstr "Rastgele sıralanmış yansılar kullanılsın" #: pacman_mirrors/txt.py:90 msgid "Check mirrors for your personal list" -msgstr "" +msgstr "Özel listeniz için yansıları kontrol edin" #: pacman_mirrors/txt.py:91 msgid "Use" @@ -247,11 +249,11 @@ msgstr "Ülke" #: pacman_mirrors/txt.py:93 msgid "Resp" -msgstr "" +msgstr "Kısa" #: pacman_mirrors/txt.py:94 msgid "Sync" -msgstr "" +msgstr "Senk" #: pacman_mirrors/txt.py:95 msgid "URL" diff --git a/pacman_mirrors/configfn.py b/pacman_mirrors/configfn.py index 1ae359f90ed179f6c7419c073ea5678e809f9ac4..4110f088271e29d21a0103143f2612a16d41a985 100644 --- a/pacman_mirrors/configfn.py +++ b/pacman_mirrors/configfn.py @@ -106,10 +106,8 @@ def build_config(): elif key == "SSL": config["ssl"] = value except (PermissionError, OSError) as err: - print(".: {} {}: {}: {}".format(txt.ERR_CLR, - txt.CANNOT_READ_FILE, - err.filename, - err.strerror)) + print(".: {} {}: {}: {}".format(txt.ERR_CLR, txt.CANNOT_READ_FILE, + err.filename, err.strerror)) return config, custom @@ -122,10 +120,8 @@ def modify_config(config, custom=False): # remove custom file if present if os.path.isfile(config["custom_file"]): os.remove(config["custom_file"]) - - write_configuration(config["config_file"], - config["only_country"], - custom=custom) + write_configuration(config["config_file"], config["only_country"], + custom=custom) def write_configuration(filename, selection, custom=False): @@ -144,11 +140,8 @@ def write_configuration(filename, selection, custom=False): selection = "# OnlyCountry = \n" try: - with open( - filename) as cnf, tempfile.NamedTemporaryFile( - "w+t", dir=os.path.dirname( - filename), delete=False) as tmp: - + with open(filename) as cnf, tempfile.NamedTemporaryFile("w+t", + dir=os.path.dirname(filename), delete=False) as tmp: replaced = False for line in cnf: if "OnlyCountry" in line: @@ -162,5 +155,5 @@ def write_configuration(filename, selection, custom=False): os.chmod(filename, 0o644) except OSError as err: print(".: {} {}: {}: {}".format(txt.ERR_CLR, txt.CANNOT_READ_FILE, - err.filename, err.strerror)) + err.filename, err.strerror)) exit(1) diff --git a/pacman_mirrors/consolefn.py b/pacman_mirrors/consolefn.py index c211284bd922db4d0496104c445330ce5d914721..c975841a31308630f970364fb3f9254e80556b05 100644 --- a/pacman_mirrors/consolefn.py +++ b/pacman_mirrors/consolefn.py @@ -25,7 +25,6 @@ import json def list_to_tuple(list_data, named_tuple): """ Comvert list to a list with named tuples - :param list_data: the list to convert :param named_tuple: tuple list item converts to :return data: list of named tuples @@ -38,20 +37,17 @@ def list_to_tuple(list_data, named_tuple): def rows_from_tuple(servers, joiner=" | "): """ Generates equal formatted lines - :param servers: named tuples :param joiner: string used to join tuple items :return lines: list of nicely formatted lines """ rows = [] - if not servers: - return rows - - # calculate max col width - col_width = [max(len(text) for text in col) for col in zip(*servers)] - - # generate linies - for line in servers: - rows.append(joiner.join("{:{}}".format(text, col_width[i]) - for i, text in enumerate(line))) + if servers: + # calculate max col width + col_width = [max(len(text) for text in col) for col in zip(*servers)] + + # generate lines + for line in servers: + rows.append(joiner.join("{:{}}".format(text, col_width[i]) + for i, text in enumerate(line))) return rows diff --git a/pacman_mirrors/consoleui.py b/pacman_mirrors/consoleui.py index 58de5d11380fce9aad1d9eed05907756e9223c87..cc4fbe66b81541f7f21b7b6f81d668b939f35077 100644 --- a/pacman_mirrors/consoleui.py +++ b/pacman_mirrors/consoleui.py @@ -81,7 +81,6 @@ class ConsoleUI(npyscreen.NPSAppManaged): def done(self, selection): """ After editing - :param selection: """ if selection: diff --git a/pacman_mirrors/filefn.py b/pacman_mirrors/filefn.py index c463ad89ed59c1f3537ce3f0e3b46c599c98d4c6..741480326a3c95d5506c807d75976bfa26b38bb0 100644 --- a/pacman_mirrors/filefn.py +++ b/pacman_mirrors/filefn.py @@ -27,13 +27,6 @@ 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: @@ -49,13 +42,13 @@ def return_mirror_filename(config): filename = "" status = False # status.json or mirrors.json # decision on file availablity - if check_file(config["status_file"]): + if os.path.isfile(config["status_file"]): status = True filename = config["status_file"] - elif check_file(config["mirror_file"]): + elif os.path.isfile(config["mirror_file"]): filename = config["mirror_file"] - elif check_file(config["fallback_file"]): - filename = config["fallback_file"] + elif os.path.isfile(config["fallback_file"]): + filename = config["fallback_file"] if not filename: print("\n{}.:! {}{}\n".format(txt.RS, txt.HOUSTON, diff --git a/pacman_mirrors/graphicalui.py b/pacman_mirrors/graphicalui.py index f0bdb05aaf3e5f57db8ae202d0f8b912fdd83716..6e55d38261d32849a30186749767b29f39333f32 100644 --- a/pacman_mirrors/graphicalui.py +++ b/pacman_mirrors/graphicalui.py @@ -87,7 +87,8 @@ class GraphicalUI(Gtk.Window): self.button_done = Gtk.Button(txt.I_CONFIRM, sensitive=False) self.button_done.connect("clicked", self.done) - grid = Gtk.Grid(column_homogeneous=True, column_spacing=10, row_spacing=10) + grid = Gtk.Grid(column_homogeneous=True, column_spacing=10, + row_spacing=10) grid.attach(header, 0, 0, 2, 1) grid.attach(scrolled_tree, 0, 1, 2, 1) grid.attach(button_cancel, 0, 2, 1, 1) @@ -123,8 +124,8 @@ class GraphicalUI(Gtk.Window): def done(self, button): """Confirm choice""" dialog = Gtk.Dialog(txt.I_CONFIRM_SELECTION, None, 0, ( - Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, - Gtk.STOCK_OK, Gtk.ResponseType.OK)) + Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, + Gtk.STOCK_OK, Gtk.ResponseType.OK)) dialog.set_transient_for(self) dialog.set_border_width(10) box = dialog.get_content_area() diff --git a/pacman_mirrors/httpfn.py b/pacman_mirrors/httpfn.py index 96f0f83d6fcc9e2bcf867fdfe6ff0794dec062e7..9f6502e6a40e65dabd179566cae07ffcde8bd009 100644 --- a/pacman_mirrors/httpfn.py +++ b/pacman_mirrors/httpfn.py @@ -61,8 +61,7 @@ def download_mirrors(config): except (HTTPException, json.JSONDecodeError, URLError): pass - result = (fetchmirrors, fetchstatus) - return result + return (fetchmirrors, fetchstatus) def get_geoip_country(): @@ -137,11 +136,9 @@ def is_connected(remote_host, maxwait=2): # noinspection PyBroadException try: data = urlopen(remote_host, timeout=maxwait) - if data: - return True except: pass - return False + return bool(data) def ping_host(host, count=1): @@ -161,12 +158,13 @@ def update_mirrors(config): :rtype: tuple """ result = None - mjro_online = is_connected("http://repo.manjaro.org") - if mjro_online: - print(".: {} {} {}".format(txt.INF_CLR, txt.DOWNLOADING_MIRROR_FILE, txt.REPO_SERVER)) + connected = is_connected("http://repo.manjaro.org") + if connected: + print(".: {} {} {}".format(txt.INF_CLR, txt.DOWNLOADING_MIRROR_FILE, + txt.REPO_SERVER)) result = download_mirrors(config) else: - if not filefn.check_file(config["mirror_file"]): + if not os.path.isfile(config["mirror_file"]): print(".: {} {} {} {}".format(txt.WRN_CLR, txt.MIRROR_FILE, config["mirror_file"], @@ -175,8 +173,7 @@ def update_mirrors(config): txt.FALLING_BACK, conf.FALLBACK)) result = (True, False) - if not filefn.check_file(config["fallback_file"]): + if not os.path.isfile(config["fallback_file"]): print(".: {} {}".format(txt.ERR_CLR, txt.HOUSTON)) result = (False, False) - return result diff --git a/pacman_mirrors/jsonfn.py b/pacman_mirrors/jsonfn.py index b46a0dc450dcaa315fbd719c58e68bd2d5db5df5..78a4f6109419244d90b1843cd73d40e5dc113648 100644 --- a/pacman_mirrors/jsonfn.py +++ b/pacman_mirrors/jsonfn.py @@ -34,7 +34,6 @@ def read_json_file(filename, dictionary=True): else: with open(filename, "r") as infile: result = json.load(infile) - except OSError: pass return result diff --git a/pacman_mirrors/mirror.py b/pacman_mirrors/mirror.py index 264bce48fdbc32878a090a24f0493725f9115b6a..3d3828435fb22601c505db2e648ca3b98275d0f9 100644 --- a/pacman_mirrors/mirror.py +++ b/pacman_mirrors/mirror.py @@ -67,6 +67,6 @@ class Mirror: for server in mirrors: if status: self.add(server["country"], server["url"], server["protocols"], - server["branches"], server["last_sync"]) + server["branches"], server["last_sync"]) else: self.add(server["country"], server["url"], server["protocols"]) diff --git a/pacman_mirrors/mirrorfn.py b/pacman_mirrors/mirrorfn.py index c7669f160aa917ba22b106e5b29a20c8e1448c6a..3c6bd07f3386b770b97fbf1d722e0b15d95e61c9 100644 --- a/pacman_mirrors/mirrorfn.py +++ b/pacman_mirrors/mirrorfn.py @@ -32,19 +32,14 @@ def build_country_list(selectedcountries, countrylist, geoip=False): :rtype: list """ result = [] - if selectedcountries: - if selectedcountries == ["all"]: - result = countrylist - else: - if validfn.country_list_is_valid(selectedcountries, countrylist): - result = selectedcountries - if not result: - if geoip: - country = get_geoip_country(countrylist) - if country: # valid geoip - result = country - else: - result = countrylist + if selectedcountries == ["all"]: + result = countrylist + elif validfn.country_list_is_valid(selectedcountries, countrylist): + result = selectedcountries + if not result and geoip: + country = get_geoip_country(countrylist) + if country: # valid geoip + result = country else: result = countrylist return result diff --git a/pacman_mirrors/miscfn.py b/pacman_mirrors/miscfn.py index c275f42d42ed756d8da4cae2d80ae55b65f6ca08..c6e018af254d51582bf8ac02241b15e6656bc38f 100644 --- a/pacman_mirrors/miscfn.py +++ b/pacman_mirrors/miscfn.py @@ -25,10 +25,8 @@ from . import txt def debug(where, what, value): """Helper for printing debug messages""" - print("{} In function {} -> '{} = {}'".format(txt.DBG_CLR, - where, - what, - value)) + print("{} In function {} -> '{} = {}'".format(txt.DBG_CLR, where, what, + value)) def internet_message(): @@ -44,5 +42,4 @@ def terminal_size(): # http://www.programcreek.com/python/example/85471/shutil.get_terminal_size cols = shutil.get_terminal_size().columns lines = shutil.get_terminal_size().lines - result = (cols, lines) - return result + return (cols, lines) diff --git a/pacman_mirrors/pacman_mirrors.py b/pacman_mirrors/pacman_mirrors.py index 7672c5311cb5a941400ab788246ed32139b7cae9..9b9de1d8eed79181fedb048801aaa21090cd4376 100644 --- a/pacman_mirrors/pacman_mirrors.py +++ b/pacman_mirrors/pacman_mirrors.py @@ -123,7 +123,8 @@ class PacmanMirrors: parser.add_argument("-f", "--fasttrack", type=int, metavar=txt.DIGIT, - help="{} {}".format(txt.HLP_ARG_FASTTRACK, txt.OVERRIDE_OPT)) + help="{} {}".format(txt.HLP_ARG_FASTTRACK, + txt.OVERRIDE_OPT)) parser.add_argument("-l", "--list", action="store_true", help=txt.HLP_ARG_LIST) @@ -350,7 +351,8 @@ class PacmanMirrors: if self.default and custom_list: if self.config["method"] == "rank": custom_list = self.test_mirrors(custom_list) - custom_list = sorted(custom_list, key=itemgetter("resp_time")) + custom_list = sorted(custom_list, + key=itemgetter("resp_time")) else: shuffle(custom_list) @@ -371,13 +373,18 @@ class PacmanMirrors: print("--------------------------") # output mirror file jsonfn.write_json_file(mirrorfile, self.config["custom_file"]) - print(".: {} {}: {}".format(txt.INF_CLR, txt.CUSTOM_MIRROR_FILE_SAVED, self.config["custom_file"])) + print(".: {} {}: {}".format(txt.INF_CLR, + txt.CUSTOM_MIRROR_FILE_SAVED, + self.config["custom_file"])) # output pacman mirrorlist - filefn.output_mirror_list(self.config, selected, custom=True, quiet=self.quiet, interactive=True) + filefn.output_mirror_list(self.config, selected, + custom=True, quiet=self.quiet, + interactive=True) # always use "Custom" from interactive self.config["only_country"] = ["Custom"] configfn.modify_config(self.config, custom=True) - print(".: {} {} {}".format(txt.INF_CLR, txt.RESET_CUSTOM_CONFIG, txt.RESET_TIP)) + print(".: {} {} {}".format(txt.INF_CLR, txt.RESET_CUSTOM_CONFIG, + txt.RESET_TIP)) else: print(".: {} {}".format(txt.WRN_CLR, txt.NO_SELECTION)) print(".: {} {}".format(txt.INF_CLR, txt.NO_CHANGE)) diff --git a/share/mirrors.json b/share/mirrors.json index 746144e1863079ae2e428a31439fd5a73fdd3d40..1af97dd442c6fcf6c84dee68e72399f06f62fd5a 100644 --- a/share/mirrors.json +++ b/share/mirrors.json @@ -1 +1 @@ -[{"country": "Australia", "url": "http://mirror.ventraip.net.au/Manjaro/", "protocols": ["http"]}, {"country": "Australia", "url": "http://manjaro.uberglobalmirror.com/", "protocols": ["http"]}, {"country": "Australia", "url": "http://manjaro.mirror.serversaustralia.com.au/", "protocols": ["http"]}, {"country": "Austria", "url": "http://mirror.inode.at/manjaro/", "protocols": ["http"]}, {"country": "Belarus", "url": "http://mirror.datacenter.by/pub/mirrors/manjaro/", "protocols": ["http"]}, {"country": "Belgium", "url": "http://ftp.belnet.be/manjaro/", "protocols": ["ftp", "http"]}, {"country": "Belgium", "url": "https://manjaro.cu.be/", "protocols": ["https"]}, {"country": "Brasil", "url": "http://linorg.usp.br/manjaro/", "protocols": ["http"]}, {"country": "Bulgaria", "url": "https://mirrors.netix.net/manjaro/", "protocols": ["http", "https"]}, {"country": "Bulgaria", "url": "http://manjaro.ipacct.com/manjaro/", "protocols": ["http"]}, {"country": "Bulgaria", "url": "http://manjaro.telecoms.bg/", "protocols": ["http"]}, {"country": "Canada", "url": "http://manjaro.cybr.ca/", "protocols": ["http"]}, {"country": "Canada", "url": "https://ca.mirror.babylon.network/manjaro/", "protocols": ["https"]}, {"country": "Chile", "url": "http://manjaro.dcc.uchile.cl/", "protocols": ["http"]}, {"country": "Chile", "url": "http://doge.ing.puc.cl/Mirrors/Manjaro/", "protocols": ["http"]}, {"country": "China", "url": "http://mirrors.ustc.edu.cn/manjaro/", "protocols": ["http"]}, {"country": "China", "url": "http://ftp.cuhk.edu.hk/pub/Linux/manjaro/", "protocols": ["ftp", "http"]}, {"country": "China", "url": "http://mirrors.tuna.tsinghua.edu.cn/manjaro/", "protocols": ["http"]}, {"country": "China", "url": "https://mirrors.zju.edu.cn/manjaro/", "protocols": ["http", "https"]}, {"country": "Colombia", "url": "http://mirror.edatel.net.co/manjaro/", "protocols": ["http"]}, {"country": "Costa_Rica", "url": "http://mirrors.ucr.ac.cr/manjaro/", "protocols": ["http"]}, {"country": "Czech", "url": "https://mirror.dkm.cz/manjaro/", "protocols": ["http", "https"]}, {"country": "Denmark", "url": "https://mirrors.dotsrc.org/manjaro/", "protocols": ["http", "https"]}, {"country": "Denmark", "url": "http://www.uex.dk/repos/manjaro/", "protocols": ["http"]}, {"country": "Ecuador", "url": "https://mirror.cedia.org.ec/manjaro/", "protocols": ["http", "https"]}, {"country": "Ecuador", "url": "https://mirror.uta.edu.ec/manjaro/", "protocols": ["http", "https"]}, {"country": "Ecuador", "url": "https://mirror.espoch.edu.ec/manjaro/", "protocols": ["http", "https"]}, {"country": "France", "url": "http://manjarolinux.polymorf.fr/", "protocols": ["http"]}, {"country": "France", "url": "http://mirror.lignux.com/manjaro/", "protocols": ["http"]}, {"country": "France", "url": "http://ftp.free.org/mirrors/repo.manjaro.org/repos/", "protocols": ["ftp", "http"]}, {"country": "France", "url": "https://fr.mirror.babylon.network/manjaro/", "protocols": ["https"]}, {"country": "Germany", "url": "http://mirror.ragenetwork.de/manjaro/", "protocols": ["http"]}, {"country": "Germany", "url": "http://ftp.halifax.rwth-aachen.de/manjaro/", "protocols": ["ftp", "http"]}, {"country": "Germany", "url": "http://ftp.tu-chemnitz.de/pub/linux/manjaro/", "protocols": ["ftp", "http"]}, {"country": "Germany", "url": "https://mirror.netzspielplatz.de/manjaro/packages/", "protocols": ["https"]}, {"country": "Germany", "url": "https://mirror.netcologne.de/manjaro/", "protocols": ["https"]}, {"country": "Germany", "url": "https://repo.rhindon.net/manjaro/", "protocols": ["https"]}, {"country": "Germany", "url": "http://mirrors.cicku.me/manjaro/", "protocols": ["http"]}, {"country": "Germany", "url": "https://repo.stdout.net/manjaro/", "protocols": ["http", "https"]}, {"country": "Germany", "url": "https://manjaro-mirror-a.alpix.eu/", "protocols": ["http", "https"]}, {"country": "Germany", "url": "http://ftp.rz.tu-bs.de/pub/mirror/manjaro.org/repos/", "protocols": ["ftp", "http"]}, {"country": "Greece", "url": "http://ftp.cc.uoc.gr/mirrors/linux/manjaro/", "protocols": ["ftp", "http"]}, {"country": "Hungary", "url": "http://mirror.infotronik.hu/mirrors/pub/manjaro/", "protocols": ["http"]}, {"country": "Indonesia", "url": "http://kambing.ui.ac.id/manjaro/", "protocols": ["http"]}, {"country": "Indonesia", "url": "http://kartolo.sby.datautama.net.id/manjaro/", "protocols": ["http"]}, {"country": "Indonesia", "url": "http://jaran.undip.ac.id/manjaro/", "protocols": ["http"]}, {"country": "Ireland", "url": "https://ftp.heanet.ie/mirrors/manjaro/", "protocols": ["ftp", "https"]}, {"country": "Italy", "url": "http://manjaro.mirror.garr.it/mirrors/manjaro/", "protocols": ["http"]}, {"country": "Italy", "url": "http://ba.mirror.garr.it/mirrors/manjaro/", "protocols": ["http"]}, {"country": "Italy", "url": "http://ct.mirror.garr.it/mirrors/manjaro/", "protocols": ["http"]}, {"country": "Japan", "url": "http://ftp.tsukuba.wide.ad.jp/Linux/manjaro/", "protocols": ["ftp", "http"]}, {"country": "Japan", "url": "http://ftp.riken.jp/Linux/manjaro/", "protocols": ["ftp", "http"]}, {"country": "Netherlands", "url": "http://ftp.nluug.nl/pub/os/Linux/distr/manjaro/", "protocols": ["ftp", "http"]}, {"country": "Netherlands", "url": "http://ftp.snt.utwente.nl/pub/linux/manjaro/", "protocols": ["ftp", "http"]}, {"country": "Netherlands", "url": "https://nl.mirror.babylon.network/manjaro/", "protocols": ["https"]}, {"country": "Philippines", "url": "http://mirror.rise.ph/manjaro/", "protocols": ["http"]}, {"country": "Poland", "url": "http://mirror.chmuri.net/manjaro/", "protocols": ["http"]}, {"country": "Portugal", "url": "http://ftp.dei.uc.pt/pub/linux/manjaro/", "protocols": ["ftp", "http"]}, {"country": "Portugal", "url": "http://repo.barata.website/", "protocols": ["http"]}, {"country": "Romania", "url": "http://mirrors.serverhost.ro/manjaro/packages/", "protocols": ["http"]}, {"country": "Romania", "url": "http://ftp.lug.ro/manjaro/", "protocols": ["ftp", "http"]}, {"country": "Russia", "url": "https://mirror.yandex.ru/mirrors/manjaro/", "protocols": ["http", "https"]}, {"country": "Russia", "url": "ftp://kibo.remi.lu/pub/", "protocols": ["ftp"]}, {"country": "Singapore", "url": "http://download.nus.edu.sg/mirror/manjaro/", "protocols": ["http"]}, {"country": "South_Africa", "url": "http://mirror.is.co.za/mirrors/manjaro.org/", "protocols": ["http"]}, {"country": "Sweden", "url": "https://ftp.lysator.liu.se/pub/manjaro/", "protocols": ["ftp", "https"]}, {"country": "Sweden", "url": "http://mirror.zetup.net/manjaro/", "protocols": ["http"]}, {"country": "Taiwan", "url": "http://free.nchc.org.tw/manjaro/", "protocols": ["http"]}, {"country": "Turkey", "url": "http://ftp.linux.org.tr/manjaro/", "protocols": ["ftp", "http"]}, {"country": "United_Kingdom", "url": "http://repo.manjaro.org.uk/", "protocols": ["http"]}, {"country": "United_Kingdom", "url": "https://www.mirrorservice.org/sites/repo.manjaro.org/repos/", "protocols": ["https"]}, {"country": "United_Kingdom", "url": "http://mirror.catn.com/pub/manjaro/", "protocols": ["http"]}, {"country": "United_Kingdom", "url": "http://manjaro.mirrors.uk2.net/", "protocols": ["http"]}, {"country": "United_States", "url": "http://mirror.dacentec.com/manjaro/", "protocols": ["http"]}, {"country": "United_States", "url": "http://mirror.jmu.edu/manjaro/", "protocols": ["http"]}, {"country": "United_States", "url": "http://mirror.solarvps.com/manjaro/", "protocols": ["http"]}, {"country": "United_States", "url": "http://mirror.nexcess.net/manjaro/", "protocols": ["http"]}, {"country": "United_States", "url": "http://distro.ibiblio.org/manjaro/", "protocols": ["http"]}, {"country": "United_States", "url": "http://mirror.clarkson.edu/manjaro/", "protocols": ["http"]}, {"country": "United_States", "url": "http://mirrors.ocf.berkeley.edu/manjaro/", "protocols": ["http"]}, {"country": "Vietnam", "url": "https://mirror.freedif.org/Manjaro/", "protocols": ["https"]}] \ No newline at end of file +[{"country":"Australia","url":"http://mirror.ventraip.net.au/Manjaro/","protocols":["http"]},{"country":"Australia","url":"http://manjaro.uberglobalmirror.com/","protocols":["http"]},{"country":"Australia","url":"http://manjaro.mirror.serversaustralia.com.au/","protocols":["http"]},{"country":"Austria","url":"http://mirror.inode.at/manjaro/","protocols":["http"]},{"country":"Belarus","url":"http://mirror.datacenter.by/pub/mirrors/manjaro/","protocols":["http"]},{"country":"Belgium","url":"http://ftp.belnet.be/manjaro/","protocols":["ftp","http"]},{"country":"Belgium","url":"https://manjaro.cu.be/","protocols":["https"]},{"country":"Brasil","url":"http://linorg.usp.br/manjaro/","protocols":["http"]},{"country":"Bulgaria","url":"https://mirrors.netix.net/manjaro/","protocols":["http","https"]},{"country":"Bulgaria","url":"http://manjaro.ipacct.com/manjaro/","protocols":["http"]},{"country":"Bulgaria","url":"http://manjaro.telecoms.bg/","protocols":["http"]},{"country":"Canada","url":"http://manjaro.cybr.ca/","protocols":["http"]},{"country":"Canada","url":"https://ca.mirror.babylon.network/manjaro/","protocols":["https"]},{"country":"Chile","url":"http://manjaro.dcc.uchile.cl/","protocols":["http"]},{"country":"Chile","url":"http://doge.ing.puc.cl/Mirrors/Manjaro/","protocols":["http"]},{"country":"China","url":"http://mirrors.ustc.edu.cn/manjaro/","protocols":["http"]},{"country":"China","url":"http://ftp.cuhk.edu.hk/pub/Linux/manjaro/","protocols":["ftp","http"]},{"country":"China","url":"http://mirrors.tuna.tsinghua.edu.cn/manjaro/","protocols":["http"]},{"country":"China","url":"https://mirrors.zju.edu.cn/manjaro/","protocols":["http","https"]},{"country":"Colombia","url":"http://mirror.edatel.net.co/manjaro/","protocols":["http"]},{"country":"Costa_Rica","url":"http://mirrors.ucr.ac.cr/manjaro/","protocols":["http"]},{"country":"Czech","url":"https://mirror.dkm.cz/manjaro/","protocols":["http","https"]},{"country":"Denmark","url":"https://mirrors.dotsrc.org/manjaro/","protocols":["http","https"]},{"country":"Denmark","url":"https://www.uex.dk/repos/manjaro/","protocols":["http","https"]},{"country":"Ecuador","url":"https://mirror.cedia.org.ec/manjaro/","protocols":["http","https"]},{"country":"Ecuador","url":"https://mirror.uta.edu.ec/manjaro/","protocols":["http","https"]},{"country":"Ecuador","url":"https://mirror.espoch.edu.ec/manjaro/","protocols":["http","https"]},{"country":"France","url":"http://manjarolinux.polymorf.fr/","protocols":["http"]},{"country":"France","url":"http://mirror.lignux.com/manjaro/","protocols":["http"]},{"country":"France","url":"http://ftp.free.org/mirrors/repo.manjaro.org/repos/","protocols":["ftp","http"]},{"country":"France","url":"https://fr.mirror.babylon.network/manjaro/","protocols":["https"]},{"country":"Germany","url":"http://mirror.ragenetwork.de/manjaro/","protocols":["http"]},{"country":"Germany","url":"http://ftp.halifax.rwth-aachen.de/manjaro/","protocols":["ftp","http"]},{"country":"Germany","url":"http://ftp.tu-chemnitz.de/pub/linux/manjaro/","protocols":["ftp","http"]},{"country":"Germany","url":"https://mirror.netzspielplatz.de/manjaro/packages/","protocols":["https"]},{"country":"Germany","url":"https://mirror.netcologne.de/manjaro/","protocols":["https"]},{"country":"Germany","url":"https://repo.rhindon.net/manjaro/","protocols":["https"]},{"country":"Germany","url":"https://repo.stdout.net/manjaro/","protocols":["http","https"]},{"country":"Germany","url":"https://manjaro-mirror-a.alpix.eu/","protocols":["http","https"]},{"country":"Germany","url":"http://ftp.rz.tu-bs.de/pub/mirror/manjaro.org/repos/","protocols":["ftp","http"]},{"country":"Greece","url":"http://ftp.cc.uoc.gr/mirrors/linux/manjaro/","protocols":["ftp","http"]},{"country":"Hungary","url":"http://mirror.infotronik.hu/mirrors/pub/manjaro/","protocols":["http"]},{"country":"Indonesia","url":"http://kambing.ui.ac.id/manjaro/","protocols":["http"]},{"country":"Indonesia","url":"http://kartolo.sby.datautama.net.id/manjaro/","protocols":["http"]},{"country":"Indonesia","url":"http://jaran.undip.ac.id/manjaro/","protocols":["http"]},{"country":"Ireland","url":"https://ftp.heanet.ie/mirrors/manjaro/","protocols":["ftp","https"]},{"country":"Italy","url":"http://manjaro.mirror.garr.it/mirrors/manjaro/","protocols":["http"]},{"country":"Italy","url":"http://ba.mirror.garr.it/mirrors/manjaro/","protocols":["http"]},{"country":"Italy","url":"http://ct.mirror.garr.it/mirrors/manjaro/","protocols":["http"]},{"country":"Japan","url":"http://ftp.tsukuba.wide.ad.jp/Linux/manjaro/","protocols":["ftp","http"]},{"country":"Japan","url":"http://ftp.riken.jp/Linux/manjaro/","protocols":["ftp","http"]},{"country":"Netherlands","url":"http://ftp.nluug.nl/pub/os/Linux/distr/manjaro/","protocols":["ftp","http"]},{"country":"Netherlands","url":"http://ftp.snt.utwente.nl/pub/linux/manjaro/","protocols":["ftp","http"]},{"country":"Netherlands","url":"https://nl.mirror.babylon.network/manjaro/","protocols":["https"]},{"country":"Philippines","url":"http://mirror.rise.ph/manjaro/","protocols":["http"]},{"country":"Poland","url":"http://mirror.chmuri.net/manjaro/","protocols":["http"]},{"country":"Portugal","url":"http://ftp.dei.uc.pt/pub/linux/manjaro/","protocols":["ftp","http"]},{"country":"Portugal","url":"http://manjaro.barata.pt/","protocols":["http"]},{"country":"Romania","url":"http://mirrors.serverhost.ro/manjaro/packages/","protocols":["http"]},{"country":"Romania","url":"http://ftp.lug.ro/manjaro/","protocols":["ftp","http"]},{"country":"Russia","url":"https://mirror.yandex.ru/mirrors/manjaro/","protocols":["http","https"]},{"country":"Singapore","url":"http://download.nus.edu.sg/mirror/manjaro/","protocols":["http"]},{"country":"South_Africa","url":"http://mirror.is.co.za/mirrors/manjaro.org/","protocols":["http"]},{"country":"Sweden","url":"https://ftp.lysator.liu.se/pub/manjaro/","protocols":["ftp","https"]},{"country":"Sweden","url":"http://mirror.zetup.net/manjaro/","protocols":["http"]},{"country":"Taiwan","url":"http://free.nchc.org.tw/manjaro/","protocols":["http"]},{"country":"Turkey","url":"http://ftp.linux.org.tr/manjaro/","protocols":["ftp","http"]},{"country":"United_Kingdom","url":"http://repo.manjaro.org.uk/","protocols":["http"]},{"country":"United_Kingdom","url":"https://www.mirrorservice.org/sites/repo.manjaro.org/repos/","protocols":["https"]},{"country":"United_Kingdom","url":"http://mirror.catn.com/pub/manjaro/","protocols":["http"]},{"country":"United_Kingdom","url":"http://manjaro.mirrors.uk2.net/","protocols":["http"]},{"country":"United_States","url":"http://mirror.dacentec.com/manjaro/","protocols":["http"]},{"country":"United_States","url":"http://mirror.jmu.edu/manjaro/","protocols":["http"]},{"country":"United_States","url":"http://mirror.solarvps.com/manjaro/","protocols":["http"]},{"country":"United_States","url":"http://mirror.nexcess.net/manjaro/","protocols":["http"]},{"country":"United_States","url":"http://distro.ibiblio.org/manjaro/","protocols":["http"]},{"country":"United_States","url":"http://mirror.clarkson.edu/manjaro/","protocols":["http"]},{"country":"United_States","url":"http://mirrors.ocf.berkeley.edu/manjaro/","protocols":["http"]},{"country":"Vietnam","url":"https://mirror.freedif.org/Manjaro/","protocols":["https"]}]