From 10f5aa579c9fe586da9bff0d6d24d4f193cd296e Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Tue, 23 Oct 2018 20:04:42 +0200 Subject: [PATCH] bin/proxy.py clean up --- lib/globals.py | 5 +++++ lib/translations.py | 32 +++++++++++++++++++++----------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/lib/globals.py b/lib/globals.py index 8ca331c..313dbc8 100644 --- a/lib/globals.py +++ b/lib/globals.py @@ -39,6 +39,10 @@ GEOLOCATOR_SERVICE = 'http://localhost:8004' LISTEN_HOST = "" LISTEN_PORT = 8002 +PROXY_HOST = "127.0.0.1" +PROXY_PORT = 5001 +PROXY_CACHEDIR = "api-cache" + MY_EXTERNAL_IP = '5.9.243.187' PLAIN_TEXT_AGENTS = [ @@ -53,6 +57,7 @@ PLAIN_TEXT_PAGES = [':help', ':bash.function', ':translation'] IP2LOCATION_KEY = '' + def error(text): "log error `text` and raise a RuntimeError exception" diff --git a/lib/translations.py b/lib/translations.py index 5912ca5..4ad67b6 100644 --- a/lib/translations.py +++ b/lib/translations.py @@ -1,19 +1,29 @@ -# vim: set encoding=utf-8 +# vim: fileencoding=utf-8 + +""" +Translation of almost everything. +""" FULL_TRANSLATION = [ - "de", "fr", "id", "it", "nb", "nl", "pl", "ru", + "de", "fr", "id", "it", "nb", "nl", "pl", "ru", ] PARTIAL_TRANSLATION = [ - "az", "be", "bg", "bs", "ca", "cy", "cs", - "da", "el", "eo", "es", "et", "fi", - "hi", "hr", "hu", "hy", "is", - "ja", "jv", "ka", "kk", "ko", "ky", "lt", - "lv", "mk", "ml", "nl", "nn", "pt", - "ro", "sk", "sl", "sr", "sr-lat", - "sv", "sw", "th", "tr", "te", "uk", "uz", "vi", - "zh", "zu", - "he", + "az", "be", "bg", "bs", "ca", "cy", "cs", + "da", "el", "eo", "es", "et", "fi", + "hi", "hr", "hu", "hy", "is", + "ja", "jv", "ka", "kk", "ko", "ky", "lt", + "lv", "mk", "ml", "nl", "nn", "pt", + "ro", "sk", "sl", "sr", "sr-lat", + "sv", "sw", "th", "tr", "te", "uk", "uz", "vi", + "zh", "zu", + "he", +] + +PROXY_LANGS = [ + 'az', 'bs', 'ca', 'cy', 'eo', 'he', 'hr', + 'hy', 'id', 'is', 'it', 'ja', + 'kk', 'lv', 'mk', 'nb', 'nn', 'sl', 'uz' ]