[tor-commits] [gettor/master] Attempt to improve the overall usability
kaner at torproject.org
kaner at torproject.org
Sat Sep 3 12:35:54 UTC 2011
commit a4bf1bd7da331a159d93cc45b255100f79f2e554
Author: Christian Fromme <kaner at strace.org>
Date: Sat Aug 27 18:18:16 2011 +0200
Attempt to improve the overall usability
- Better help texts explaining what packages are for whom
- Change package names
- Add a hint on how to unpack the files
- Remove WinRAR hint and link
---
README | 2 +-
README.USER-HOWTO | 12 +-
gettor.conf | 81 ++++----
lib/gettor/config.py | 2 +-
lib/gettor/filters.py | 11 +-
lib/gettor/i18n.py | 557 ++++++++++++-----------------------------------
lib/gettor/packages.py | 6 +-
lib/gettor/requests.py | 2 +-
lib/gettor/responses.py | 232 +++++++++++++-------
9 files changed, 347 insertions(+), 558 deletions(-)
diff --git a/README b/README
index 1988a61..b7a2084 100644
--- a/README
+++ b/README
@@ -134,7 +134,7 @@ and should look similar to this:
# "bundle name": ("single file regex", "split file regex")
- PACKAGES = { "tor-browser-bundle":
+ PACKAGES = { "windows":
("tor-browser-.*_en-US.exe$", "tor-browser-.*_en-US_split"), }
diff --git a/README.USER-HOWTO b/README.USER-HOWTO
index f068e02..6929190 100644
--- a/README.USER-HOWTO
+++ b/README.USER-HOWTO
@@ -31,12 +31,12 @@ choices. An example reply to a request for help follows:
I am sorry, but your request was not understood. Please select one of the
following package names:
- panther-bundle
- source-bundle
- windows-bundle
- tiger-bundle
- tor-browser-bundle
- tor-im-browser-bundle
+ windows
+ macosx-i386
+ macosx-ppc
+ linux-i386
+ linux-x86_64
+ source
Please send me another email. It only needs a single package name anywhere
in the body of your email.
diff --git a/gettor.conf b/gettor.conf
index 276e122..4b42105 100644
--- a/gettor.conf
+++ b/gettor.conf
@@ -50,124 +50,121 @@ PACKAGES = {
# "bundle name":
# ("single file regex", # Path names need to be relative to
# "split file regex"), # BASEDIR/dist
- "tor-browser-bundle":
+ "windows":
("torbrowser/tor-browser-*_en-US.exe",
"torbrowser/tor-browser-*_en-US_split"),
- "tor-browser-bundle_en":
+ "windows_en":
("torbrowser/tor-browser-*_en-US.exe",
"torbrowser/tor-browser-*_en-US_split"),
- "tor-browser-bundle_de":
+ "windows_de":
("torbrowser/tor-browser-*_de.exe",
"torbrowser/tor-browser-*_de_split"),
- "tor-browser-bundle_ar":
+ "windows_ar":
("torbrowser/tor-browser-*_ar.exe",
"torbrowser/tor-browser-*_ar_split"),
- "tor-browser-bundle_es":
+ "windows_es":
("torbrowser/tor-browser-*_es-ES.exe",
"torbrowser/tor-browser-*_es-ES_split"),
- "tor-browser-bundle_fa":
+ "windows_fa":
("torbrowser/tor-browser-*_fa.exe",
"torbrowser/tor-browser-*_fa_split"),
- "tor-browser-bundle_fr":
+ "windows_fr":
("torbrowser/tor-browser-*_fr.exe",
"torbrowser/tor-browser-*_fr_split"),
- "tor-browser-bundle_it":
+ "windows_it":
("torbrowser/tor-browser-*_it.exe",
"torbrowser/tor-browser-*_it_split"),
- "tor-browser-bundle_nl":
+ "windows_nl":
("torbrowser/tor-browser-*_nl.exe",
"torbrowser/tor-browser-*_nl_split"),
- "tor-browser-bundle_pl":
+ "windows_pl":
("torbrowser/tor-browser-*_pl.exe",
"torbrowser/tor-browser-*_pl_split"),
- "tor-browser-bundle_pt":
+ "windows_pt":
("torbrowser/tor-browser-*_pt-PT.exe",
"torbrowser/tor-browser-*_pt-PT_split"),
- "tor-browser-bundle_ru":
+ "windows_ru":
("torbrowser/tor-browser-*_ru.exe",
"torbrowser/tor-browser-*_ru_split"),
- "tor-browser-bundle_zh_CN":
+ "windows_zh_CN":
("torbrowser/tor-browser-*_zh-CN.exe",
"torbrowser/tor-browser-*_zh-CN_split"),
- "source-bundle":
+ "source":
("tor-*.tar.gz",
"unavailable"),
- "windows-bundle":
- ("vidalia-bundles/vidalia-bundle-*.exe",
- "unavailable"),
- "macosx-ppc-bundle":
+ "macosx-ppc":
("vidalia-bundles/vidalia-bundle-*-ppc.dmg",
"unavailable"),
- "macosx-i386-bundle":
+ "macosx-i386":
("vidalia-bundles/vidalia-bundle-*-i386.dmg",
"unavailable"),
- "linux-browser-bundle-i386":
+ "linux-i386":
("torbrowser/linux/tor-browser-gnu-linux-i686-*-en-US.tar.gz",
"unavailable"),
- "linux-browser-bundle-i386_en":
+ "linux-i386_en":
("torbrowser/linux/tor-browser-gnu-linux-i686-*-en-US.tar.gz",
"unavailable"),
- "linux-browser-bundle-i386_ar":
+ "linux-i386_ar":
("torbrowser/linux/tor-browser-gnu-linux-i686-*-ar.tar.gz",
"unavailable"),
- "linux-browser-bundle-i386_de":
+ "linux-i386_de":
("torbrowser/linux/tor-browser-gnu-linux-i686-*-de.tar.gz",
"unavailable"),
- "linux-browser-bundle-i386_es-ES":
+ "linux-i386_es-ES":
("torbrowser/linux/tor-browser-gnu-linux-i686-*-es-ES.tar.gz",
"unavailable"),
- "linux-browser-bundle-i386_fa":
+ "linux-i386_fa":
("torbrowser/linux/tor-browser-gnu-linux-i686-*-fa.tar.gz",
"unavailable"),
- "linux-browser-bundle-i386_fr":
+ "linux-i386_fr":
("torbrowser/linux/tor-browser-gnu-linux-i686-*-fr.tar.gz",
"unavailable"),
- "linux-browser-bundle-i386_it":
+ "linux-i386_it":
("torbrowser/linux/tor-browser-gnu-linux-i686-*-it.tar.gz",
"unavailable"),
- "linux-browser-bundle-i386_nl":
+ "linux-i386_nl":
("torbrowser/linux/tor-browser-gnu-linux-i686-*-nl.tar.gz",
"unavailable"),
- "linux-browser-bundle-i386_pl":
+ "linux-i386_pl":
("torbrowser/linux/tor-browser-gnu-linux-i686-*-pl.tar.gz",
"unavailable"),
- "linux-browser-bundle-i386_ru":
+ "linux-i386_ru":
("torbrowser/linux/tor-browser-gnu-linux-i686-*-ru.tar.gz",
"unavailable"),
- "linux-browser-bundle-i386_zh_CN":
+ "linux-i386_zh_CN":
("torbrowser/linux/tor-browser-gnu-linux-i686-*-zh-CN.tar.gz",
"unavailable"),
- "linux-browser-bundle-x86_64":
+ "linux-x86_64":
("torbrowser/linux/tor-browser-gnu-linux-x86_64-*-en-US.tar.gz",
"unavailable"),
- "linux-browser-bundle-x86_64_en":
+ "linux-x86_64_en":
("torbrowser/linux/tor-browser-gnu-linux-x86_64-*-en-US.tar.gz",
"unavailable"),
- "linux-browser-bundle-x86_64_ar":
+ "linux-x86_64_ar":
("torbrowser/linux/tor-browser-gnu-linux-x86_64-*-ar.tar.gz",
"unavailable"),
- "linux-browser-bundle-x86_64_de":
+ "linux-x86_64_de":
("torbrowser/linux/tor-browser-gnu-linux-x86_64-*-de.tar.gz",
"unavailable"),
- "linux-browser-bundle-x86_64_es-ES":
+ "linux-x86_64_es-ES":
("torbrowser/linux/tor-browser-gnu-linux-x86_64-*-es-ES.tar.gz",
"unavailable"),
- "linux-browser-bundle-x86_64_fa":
+ "linux-x86_64_fa":
("torbrowser/linux/tor-browser-gnu-linux-x86_64-*-fa.tar.gz",
"unavailable"),
- "linux-browser-bundle-x86_64_fr":
+ "linux-x86_64_fr":
("torbrowser/linux/tor-browser-gnu-linux-x86_64-*-fr.tar.gz",
"unavailable"),
- "linux-browser-bundle-x86_64_it":
+ "linux-x86_64_it":
("torbrowser/linux/tor-browser-gnu-linux-x86_64-*-it.tar.gz",
"unavailable"),
- "linux-browser-bundle-x86_64_nl":
+ "linux-x86_64_nl":
("torbrowser/linux/tor-browser-gnu-linux-x86_64-*-nl.tar.gz",
"unavailable"),
- "linux-browser-bundle-x86_64_pl":
+ "linux-x86_64_pl":
("torbrowser/linux/tor-browser-gnu-linux-x86_64-*-pl.tar.gz",
"unavailable"),
- "linux-browser-bundle-x86_64_zh_CN":
+ "linux-x86_64_zh_CN":
("torbrowser/linux/tor-browser-gnu-linux-x86_64-*-zh-CN.tar.gz",
"unavailable"),
# Mike won't sign Torbutton; He doesn't get gettor support
diff --git a/lib/gettor/config.py b/lib/gettor/config.py
index 0efa1f4..16fb8b8 100644
--- a/lib/gettor/config.py
+++ b/lib/gettor/config.py
@@ -46,7 +46,7 @@ CONFIG_DEFAULTS = {
'DEFAULT_LOCALE': "en",
'SUPP_LANGS': { 'en': ("english", ), },
'PACKAGES': {
- "tor-browser-bundle":
+ "windows":
("tor-browser-.*_en-US.exe$",
"tor-browser-.*_en-US_split"), }
}
diff --git a/lib/gettor/filters.py b/lib/gettor/filters.py
index f2f0534..ff0cfb4 100644
--- a/lib/gettor/filters.py
+++ b/lib/gettor/filters.py
@@ -18,11 +18,10 @@ def doPackageHacks(packageName, locale):
suffix. This isn't nice because we're hard-coding package names here
Attention: This needs to correspond to the packages in packages.py
"""
- if packageName == "tor-browser-bundle" \
- or packageName == "tor-im-browser-bundle" \
- or packageName == "linux-browser-bundle-i386" \
- or packageName == "linux-browser-bundle-x86_64":
- # "tor-browser-bundle" => "tor-browser-bundle_de"
+ if packageName == "windows" \
+ or packageName == "linux-i386" \
+ or packageName == "linux-x86_64":
+ # "windows" => "windows_de"
packageName += "_" + locale
return packageName
@@ -48,7 +47,7 @@ def doToAddressHack(toAddress):
'torfarsi1 at torproject.org', we understand it to reply in Farsi to that
email.
"""
- if re.compile(".*torfarsi1 at torproject.org.*").match(toAddress):
+ if re.compile(".*torfarsi.*@torproject.org.*").match(toAddress):
return "<gettor+fa at torproject.org>"
else:
return toAddress
diff --git a/lib/gettor/i18n.py b/lib/gettor/i18n.py
index 6f40bd1..54e365e 100644
--- a/lib/gettor/i18n.py
+++ b/lib/gettor/i18n.py
@@ -22,421 +22,47 @@ def _(text):
"""
return text
-# Giant multi language help message. Add more translations as they become ready
-MULTILANGHELP = """
- Hello, This is the "GetTor" robot.
-
- I will mail you a Tor package, if you tell me which one you want.
- Please select one of the following package names:
-
- tor-browser-bundle
- macosx-i386-bundle
- macosx-ppc-bundle
- linux-browser-bundle-i386
- linux-browser-bundle-x86_64
- source-bundle
-
- Please reply to this mail (to gettor), and tell me
- a single package name anywhere in the body of your email.
-
- OBTAINING LOCALIZED VERSIONS OF TOR
- ===================================
-
- To get a version of Tor translated into your language, specify the
- language you want in the address you send the mail to:
-
- gettor+zh
-
- This example will give you the requested package in a localized
- version for Chinese. Check below for a list of supported language
- codes.
-
- List of supported locales:
- -------------------------
-
- Here is a list of all available languages:
-
- gettor+ar: Arabic
- gettor+de: German
- gettor+en: English
- gettor+es: Spanish
- gettor+fa: Farsi (Iran)
- gettor+fr: French
- gettor+it: Italian
- gettor+nl: Dutch
- gettor+pl: Polish
- gettor+ru: Russian
- gettor+zh: Chinese
-
- If you select no language, you will receive the English version.
-
- SUPPORT
- =======
-
- If you have any questions or it doesn't work, you can contact a
- human at this support email address: tor-assistants
-
- --
-
- Ù
رØØ¨Ø§Ø Ø£Ùا رÙبÙت \"اØص٠عÙ٠تÙر\".
-
- سأرس٠ÙÙ ØزÙ
Ø© براÙ
ج تÙØ±Ø Ø¥Ø°Ø§ أخبرتÙ٠أÙÙا ترÙد.
- رجاء اختر Ø¥Øد٠أسÙ
اء اÙØزÙ
اÙتاÙÙØ©:
-
- tor-browser-bundle
- macosx-i386-bundle
- macosx-ppc-bundle
- linux-browser-bundle-i386
- linux-browser-bundle-x86_64
- source-bundle
-
- Ùرج٠أ٠ترد عÙÙ Ùذ٠اÙرساÙØ© (Ø¥ÙÙ gettor at torproject.org)Ø ÙتخبرÙÙ
- باسÙ
ØزÙ
Ø© ÙاØدة ÙÙØ· Ù٠أ٠Ù
Ùا٠ضÙ
٠رساÙØ© اÙرد.
-
- اÙØصÙ٠عÙ٠إصدارات Ù
ترجÙ
Ø© Ù
٠تÙر
- ========================
-
- ÙتØص٠عÙ٠إصدار تÙر Ù
ترجÙ
Ø¥ÙÙ ÙغتÙØ Ùرج٠أ٠تØدد
- اÙÙغة اÙت٠ترÙد ضÙ
٠اÙعÙÙا٠اÙذ٠سترس٠اÙرساÙØ© اÙØ¥ÙÙترÙÙÙØ© Ø¥ÙÙÙ:
-
- gettor+zh at torproject.org
-
- Ùذا اÙÙ
ثا٠ÙعطÙ٠اÙØزÙ
Ø© اÙÙ
Ø·ÙÙبة Ù
ترجÙ
Ø©
- ÙÙغة اÙصÙÙÙØ©. تØÙÙ Ù
٠اÙÙائÙ
Ø© أدÙا٠Ùتجد رÙ
Ùز اÙÙغات
- اÙÙ
دعÙÙ
Ø©.
-
- ÙائÙ
Ø© اÙÙغات اÙÙ
دعÙÙ
Ø©:
- -------------------
-
- Ùا ÙÙ ÙائÙ
Ø© اÙÙغات اÙÙ
تÙÙرة:
-
- gettor+ar at torproject.org: اÙعربÙØ©
- gettor+de at torproject.org: اÙØ£ÙÙ
اÙÙØ©
- gettor+en at torproject.org: اÙØ¥ÙÙÙÙزÙØ©
- gettor+es at torproject.org: اÙإسباÙÙØ©
- gettor+fa at torproject.org: اÙÙارسÙØ©
- gettor+fr at torproject.org: اÙÙرÙسÙØ©
- gettor+it at torproject.org: اÙØ¥ÙطاÙÙØ©
- gettor+nl at torproject.org: اÙÙÙÙÙدÙØ©
- gettor+pl at torproject.org: اÙبÙÙÙدÙØ©
- gettor+ru at torproject.org: اÙرÙسÙØ©
- gettor+zh at torproject.org: اÙصÙÙÙØ©
-
- Ø¥Ù ÙÙ
تÙÙ
باختÙار Ùغة ÙستØص٠عÙ٠اÙإصدارة اÙØ¥ÙÙÙÙزÙØ©.
-
- اÙدعÙ
اÙÙÙÙ
- =======
-
- Ø¥Ù ÙاÙت ÙدÙ٠أÙØ© أسئÙØ© أ٠إذا ÙÙ
ÙعÙ
Ù Ùذا اÙØÙ ÙÙ
ÙÙ٠اÙاتصا٠بÙائÙ
- بشر٠عÙ٠عÙÙا٠اÙدعÙ
اÙÙÙ٠اÙتاÙÙ: tor-assistants at torproject.org
-
- --
-
- سÙاÙ
! رÙبات "GetTor" در خدÙ
ت Ø´Ù
است.
-
- ÚÙاÙÚ٠ب٠Ù
٠بگÙÛÛد ک٠ب٠کداÙ
ÛÚ© از بست٠ÙØ§Û Tor ÙÛاز دارÛØ¯Ø Ø¢Ù Ø±Ø§ Ø¨Ø±Ø§Û Ø´Ù
ا
- ارسا٠خÙاÙÙ
کرد.
- ÙØ·Ùا ÛÚ©Û Ø§Ø² بست٠ÙØ§Û Ø±Ø§ زÛر با ذکر ÙاÙ
اÙتخاب Ú©ÙÛد:
-
- tor-browser-bundle
- macosx-i386-bundle
- macosx-ppc-bundle
- linux-browser-bundle-i386
- linux-browser-bundle-x86_64
- source-bundle
-
- ÙØ·Ùا ب٠اÛÙ ÙاÙ
٠پاسخ داد٠( ب٠آدرس gettor at torproject.org ) ٠در ÙسÙ
ØªÛ Ø§Ø²
- Ù
ت٠اÛÙ
ÛÙ Ø®Ùد ÙاÙ
ÛÚ©Û Ø§Ø² بست٠ÙØ§Û ÙÙ٠را ذکر Ú©ÙÛد.
-
- تÙÛÙ Ùسخ٠ترجÙ
٠شد٠TOR
- ===================================
-
- Ø¨Ø±Ø§Û Ø¯Ø±ÛاÙت ÙØ³Ø®Ù Ø§Û Ø§Ø² TOR ترجÙ
٠شد٠ب٠زبا٠Ù
ØÙÛ Ø´Ù
Ø§Ø Ù
Û Ø¨Ø§ÛØ³ØªÛ Ø²Ø¨Ø§Ù Ù
Ùرد
- Ùظر Ø®Ùد را در آدرس Ú¯ÛرÙد٠اÛÙ
Û٠ذکر Ú©ÙÛد. بعÙÙا٠Ù
ثاÙ:
-
- gettor+zh at torproject.org
-
- در اÛÙ Ù
ثاÙØ ÙرستÙد٠خÙاÙا٠Ùسخ٠ترجÙ
٠شد٠ب٠زبا٠ÚÛÙÛ Ù
Û Ø¨Ø§Ø´Ø¯. Ø¨Ø±Ø§Û Ø¢Ú¯Ø§ÙÛ
- از کدÙØ§Û Ù
ربÙØ· ب٠زباÙÙØ§Û Ùاب٠پشتÛباÙÛ ØªÙسط Tor Ø ÙÙرست زÛر را Ù
طاÙع٠کÙÛد:
- ÙÙرست زباÙÙØ§Û Ù¾Ø´ØªÛاÙÛ Ø´Ø¯Ù
- -------------------------
-
- gettor+ar at torproject.org: Arabic
- gettor+de at torproject.org: German
- gettor+en at torproject.org: English
- gettor+es at torproject.org: Spanish
- gettor+fa at torproject.org: Farsi (Iran)
- gettor+fr at torproject.org: French
- gettor+it at torproject.org: Italian
- gettor+nl at torproject.org: Dutch
- gettor+pl at torproject.org: Polish
- gettor+ru at torproject.org: Russian
- gettor+zh at torproject.org: Chinese
-
- ÚÙاÙÚÙ ÙÛÚÛÚ© از زباÙÙØ§Û ÙÙ٠را اÙتخاب ÙÚ©ÙÛØ¯Ø Ùسخ٠اÙÚ¯ÙÛØ³Û Ø¨Ø±Ø§Û Ø´Ù
ا ارساÙ
- Ø®ÙاÙد شد.
-
- پشتÛباÙÛ
- =======
-
- ÚÙاÙÚ٠سÙاÙÛ Ø¯Ø§Ø±Ûد Ûا برÙاÙ
٠دÚار اشکا٠بÙد٠٠کار ÙÙ
Û Ú©Ùد Ø Ø¨Ø§ ÙسÙ
ت
- پشتÛباÙÛ Ø¨Ø§ آدرس زÛر تÙ
اس بگÛرÛد تا ÛÚ© اÙسا٠ب٠سÙا٠شÙ
ا پاسخ دÙد: tor-assistants at torproject.org
-
- --
-
- Hei, dette er "GetTor"-roboten
-
- Jeg kommer til å sende deg en Tor-pakke, hvis du forteller meg hvilken du
- vil ha.
- Vennligst velg en av følgende pakkenavn:
-
- tor-browser-bundle
- macosx-i386-bundle
- macosx-ppc-bundle
- linux-browser-bundle-i386
- linux-browser-bundle-x86_64
- source-bundle
-
- Vennligst svar til denne eposten (til gettor at torproject.org), og nevn
- kun et enkelt pakkenavn i tekstområdet til eposten din.
-
- SKAFFE LOKALISERTE VERSJONER AV TOR
- ===================================
-
- For å skaffe en versjon av Tor som har blitt oversatt til ditt språk,
- spesifiser språket du vil i epostadressen du sender eposten til:
-
- gettor+zh at torproject.org
-
- Dette eksempelet vil gi deg en forespurt pakke som er en oversatt
- versjon for kinesisk. Se listen nedenfor for hvilke språk det er støtte for.
-
- Liste av støttede språk:
- -------------------------
-
- Her er en liste av språkene som er tilgjengelig:
-
- gettor+ar at torproject.org: Arabisk
- gettor+de at torproject.org: Tysk
- gettor+en at torproject.org: Engelsk
- gettor+es at torproject.org: Spansk
- gettor+fa at torproject.org: Farsi (Iran)
- gettor+fr at torproject.org: Fransk
- gettor+it at torproject.org: Italiensk
- gettor+nl at torproject.org: Nederlandsk
- gettor+pl at torproject.org: Polsk
- gettor+ru at torproject.org: Russisk
- gettor+zh at torproject.org: Kinesisk
-
- Hvis du ikke spesifiserer noen språk vil du motta standard Engelsk
- versjon
-
- STÃTTE
- =======
-
- Hvis du har noen spørsmål eller det ikke virker, kan du kontakte et
- menneske på denne support-eposten: tor-assistants at torproject.org
-
- --
-
- Olá! Este é o robot "GetTor".
-
- Eu envio-lhe um pacote Tor, bastando para isso dizer qual o que quer.
- Escolha um dos seguintes pacotes:
-
- tor-browser-bundle
- macosx-i386-bundle
- macosx-ppc-bundle
- linux-browser-bundle-i386
- linux-browser-bundle-x86_64
- source-bundle
-
- Por favor responda a esta email (para gettor at torproject.org), e diga qual o
- pacote que deseja, colocando o seu nome no corpo do seu email.
-
- OBTER VERSÃES TRADUZIDAS DO TOR
- ===================================
-
- Para lhe ser enviado uma versão traduzida do Tor, especifique a lÃngua no
- destinatário do seu email:
-
- gettor+zh at torproject.org
-
- Este exemplo vai enviar o pacote traduzido para Chinês Simplificado. Veja a
- lista de endereços de email existentes que pode utilizar:
-
- Lista de endereços de email suportados:
- -------------------------
-
- gettor+pt at torproject.org: Português
- gettor+ar at torproject.org: Arábico
- gettor+de at torproject.org: Alemão
- gettor+en at torproject.org: Inglês
- gettor+es at torproject.org: Espanhol
- gettor+fa at torproject.org: Farsi (Irão)
- gettor+fr at torproject.org: Francês
- gettor+it at torproject.org: Italiano
- gettor+nl at torproject.org: Holandês
- gettor+pl at torproject.org: Polaco
- gettor+ru at torproject.org: Russo
- gettor+zh at torproject.org: Chinês
-
- Se não escolher nenhuma lÃngua, receberá o Tor em Inglês.
-
- SUPORTE
- =======
-
- Se tiver alguma dúvida, pode contactar um humano através do seguinte
- endereço: tor-assistants at torproject.org
-
- --
-
- ÐдÑавÑÑвÑйÑе! ÐÑо "ÑÐ¾Ð±Ð¾Ñ GetTor".
-
- Я оÑоÑÐ»Ñ Ð²Ð°Ð¼ Ð¿Ð°ÐºÐµÑ Tor еÑли Ð²Ñ ÑкажеÑе коÑоÑÑй Ð²Ñ Ñ
оÑиÑе.
- ÐожалÑйÑÑа вÑбеÑиÑе один из пакеÑов:
-
- tor-browser-bundle
- macosx-i386-bundle
- macosx-ppc-bundle
- linux-browser-bundle-i386
- linux-browser-bundle-x86_64
- source-bundle
-
- ÐожалÑйÑÑа ÑвÑжиÑеÑÑ Ñ Ð½Ð°Ð¼Ð¸ по ÑÑой ÑлкÑÑонной поÑÑе
- (gettor at torproject.org), и ÑкажиÑе
- название одного из пакеÑов в лÑбом меÑÑе в "Ñеле" ваÑего пиÑÑма.
-
- ÐÐÐУЧÐÐÐÐ ÐÐÐÐÐÐÐÐÐ ÐÐÐÐÐЫХ ÐÐРСÐÐ TOR
- ===================================
-
- ЧÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð²ÐµÑÑÐ¸Ñ Tor пеÑеведеннÑÑ Ð½Ð° Ð²Ð°Ñ ÑзÑк,ÑкажиÑе
- пÑедпоÑиÑаемÑй ÑзÑк в адÑеÑной ÑÑÑоке кÑда Ð²Ñ Ð¾ÑоÑлали ÑлекÑÑоннÑÑ Ð¿Ð¾ÑÑÑ:
-
- gettor+zh at torproject.org
-
- ÐÑÑеÑказаннÑй пÑÐ¸Ð¼ÐµÑ Ð´Ð°ÑÑ Ð²Ð°Ð¼ запÑоÑеннÑй Ð¿Ð°ÐºÐµÑ Ð² локализиÑованной
- веÑÑии киÑайÑкого ÑзÑка. ÐÑовеÑÑÑе ниже ÑпиÑок кодов поддеÑживаемÑÑ
- ÑзÑков.
-
- СпиÑок поддеÑживаемÑÑ
Ñегионов
- -------------------------
-
- Ðиже Ñказан ÑпиÑок вÑеÑ
доÑÑÑпнÑÑ
ÑзÑков:
-
- gettor+ar at torproject.org: аÑабÑкий
- gettor+de at torproject.org: немеÑкий
- gettor+en at torproject.org: английÑкий
- gettor+es at torproject.org: иÑпанÑкий
- gettor+fa at torproject.org: ÑаÑÑи (ÐÑан)
- gettor+fr at torproject.org: ÑÑанÑÑзÑкий
- gettor+it at torproject.org: иÑалÑÑнÑкий
- gettor+nl at torproject.org: голландÑкий
- gettor+pl at torproject.org: полÑÑкий
- gettor+ru at torproject.org: ÑÑÑÑкий
- gettor+zh at torproject.org: киÑайÑкий
-
- ÐÑли Ð²Ñ Ð½Ðµ вÑбеÑиÑе ÑзÑк, Ð²Ñ Ð¿Ð¾Ð»ÑÑиÑе веÑÑÐ¸Ñ Ð½Ð° английÑком ÑзÑке.
-
- ÐÐÐÐÐÐ ÐÐÐ
- =======
-
- ÐÑли Ñ Ð²Ð°Ñ Ð²Ð¾Ð¿ÑоÑÑ Ð¸Ð»Ð¸ ÑÑо Ñо не ÑÑабоÑало, Ð²Ñ Ð¼Ð¾Ð¶ÐµÑе ÑвÑзаÑÑÑÑ
- Ñ Ð¶Ð¸Ð²Ñм пÑедÑÑавиÑелем по ÑÑÐ¾Ð¼Ñ ÑлекÑÑÐ¾Ð½Ð½Ð¾Ð¼Ñ Ð°Ð´ÑеÑÑ:tor-assistants at torproject.org
-
- --
-
- ä½ å¥½, è¿éæ¯"GetTor"èªå¨åå¤ã
-
- æ¨ä»è¿éå¯ä»¥å¾å°Torå¥ä»¶, 请åè¯ææ¨éè¦çå¥ä»¶ç§ç±».
- 请éæ©å¥ä»¶å称:
-
- tor-browser-bundle
- (Tor+Firefoxæµè§å¨)
- macosx-i386-bundle
- (Tor for MacOS)
- macosx-ppc-bundle
- (Tor for MacOS on PowerPC )
- linux-browser-bundle-i386
- linux-browser-bundle-x86_64
- (Tor for Linux)
- source-bundle
- (æºç å
)
-
- 请ç´æ¥åå¤æ¬é®ä»¶(gettor at torproject.org),
- 并å¨ä¿¡çæ£æä¸å好æ¨æéè¦çå¥ä»¶å称ï¼ä¸å
æ¬æ¬å·å
çä¸æï¼ã
-
- è·åå
¶ä»è¯è¨çTorå¥ä»¶
- ===================================
-
- å¨æ¶ä»¶äººå°åä¸æå®è¯è¨ä»£ç å¯ä»¥è·å¾æ¬å¯¹åºè¯è¨ççæ¬ï¼ä¾å¦ï¼
-
- gettor+zh at torproject.org
-
- æ¬ä¾ä¸ï¼æ¨å°å¾å°ä¸æççTorå¥ä»¶ï¼ä¸é¢æ¯ç®åæ¯æçè¯ç§ä»£ç ï¼
-
- æ¯æè¯è¨å表:
- -------------------------
-
- å
¨é¨å¯ç¨è¯è¨å表:
-
- gettor+ar at torproject.org: Arabic
- gettor+de at torproject.org: German
- gettor+en at torproject.org: English
- gettor+es at torproject.org: Spanish
- gettor+fa at torproject.org: Farsi (Iran)
- gettor+fr at torproject.org: French
- gettor+it at torproject.org: Italian
- gettor+nl at torproject.org: Dutch
- gettor+pl at torproject.org: Polish
- gettor+ru at torproject.org: Russian
- gettor+zh at torproject.org: ä¸æ
-
- å¦ææ¨æªæå®è¯è¨ä»£ç ï¼æ¨å°æ¶å°è±æçã
-
- æ¯æ
- =======
-
- å¦ææ¨éå°å°é¾ææå¡åºç°é®é¢ï¼è¯·èç³»æ们ç
- ææ¯æ¯æé®ç®±: tor-assistants at torproject.org
-
- --
- """
-
GETTOR_TEXT = [
# GETTOR_TEXT[0]
-_("""Hello, This is the "GetTor" robot.
-
-Thank you for your request."""),
+_("""Hello, This is the "GetTor" robot."""),
# GETTOR_TEXT[1]
+_("""Thank you for your request."""),
+ # GETTOR_TEXT[2]
_(""" Unfortunately, we won't answer you at this address. You should make
-an account with GMAIL.COM or YAHOO.CN and send the mail from
+an account with GMAIL.COM, YAHOO.COM or YAHOO.CN and send the mail from
one of those."""),
- # GETTOR_TEXT[2]
+ # GETTOR_TEXT[3]
_("""We only process requests from email services that support "DKIM",
which is an email feature that lets us verify that the address in the
"From" line is actually the one who sent the mail."""),
- # GETTOR_TEXT[3]
+ # GETTOR_TEXT[4]
_("""(We apologize if you didn't ask for this mail. Since your email is from
a service that doesn't use DKIM, we're sending a short explanation,
and then we'll ignore this email address for the next day or so.)"""),
- # GETTOR_TEXT[4]
-_("""Please note that currently, we can't process HTML emails or base 64
-mails. You will need to send plain text."""),
# GETTOR_TEXT[5]
_("""If you have any questions or it doesn't work, you can contact a
human at this support email address: tor-assistants at torproject.org"""),
# GETTOR_TEXT[6]
_("""I will mail you a Tor package, if you tell me which one you want.
-Please select one of the following package names:"""),
+Please select one of the following package names:
+
+ windows
+ macos-i386
+ macos-ppc
+ linux-i386
+ linux-x86_64
+ source"""),
# GETTOR_TEXT[7]
-_("""Please reply to this mail (to gettor at torproject.org), and tell me
-a single package name anywhere in the body of your email."""),
+_("""Please reply to this mail, and tell me a single package name anywhere
+in the body of your email."""),
# GETTOR_TEXT[8]
-_(""" OBTAINING LOCALIZED VERSIONS OF TOR"""),
+_("""OBTAINING LOCALIZED VERSIONS OF TOR
+==================================="""),
# GETTOR_TEXT[9]
_("""To get a version of Tor translated into your language, specify the
-language you want in the address you send the mail to:"""),
+language you want in the address you send the mail to:
+
+ gettor+zh_CN at torproject.org"""),
# GETTOR_TEXT[10]
_("""This example will give you the requested package in a localized
version for Chinese. Check below for a list of supported language
@@ -460,14 +86,18 @@ _(""" gettor+ar at torproject.org: Arabic
# GETTOR_TEXT[14]
_("""If you select no language, you will receive the English version."""),
# GETTOR_TEXT[15]
-_("""SMALLER SIZED PACKAGES"""),
+_("""SMALLER SIZED PACKAGES
+======================"""),
# GETTOR_TEXT[16]
_("""If your bandwith is low or your provider doesn't allow you to
receive large attachments in your email, there is a feature of
GetTor you can use to make it send you a number of small packages
instead of one big one."""),
# GETTOR_TEXT[17]
-_("""Simply include the keyword 'split' somewhere in your email like so:"""),
+_("""Simply include the keyword 'split' somewhere in your email like so:
+
+ windows
+ split"""),
# GETTOR_TEXT[18]
_("""Sending this text in an email to GetTor will cause it to send you
the Tor Browser Bundle in a number of 1,4MB attachments."""),
@@ -478,38 +108,49 @@ one package again. This is done as follows:"""),
_("""1.) Save all received attachments into one folder on your disk."""),
# GETTOR_TEXT[21]
_("""2.) Unzip all files ending in ".z". If you saved all attachments to
-a fresh folder before, simply unzip all files in that folder."""),
+a fresh folder before, simply unzip all files in that folder. If you don't
+know how to unzip the .z files, please see the UNPACKING THE FILES section."""),
# GETTOR_TEXT[22]
_("""3.) Verify all files as described in the mail you received with
each package. (gpg --verify)"""),
# GETTOR_TEXT[23]
-_("""4.) Now use a program that can unrar multivolume RAR archives. On
-Windows, this usually is WinRAR. If you don't have that
-installed on you computer yet, get it here:"""),
+_("""4.) Now unpack the multi-volume archive into one file by double-
+clicking the file ending in "..split.part01.exe". This should start the
+process automatically."""),
# GETTOR_TEXT[24]
-_("""To unpack your Tor package, simply doubleclick the ".exe" file."""),
- # GETTOR_TEXT[25]
_("""5.) After unpacking is finished, you should find a newly created
".exe" file in your destination folder. Simply doubleclick
that and Tor Browser Bundle should start within a few seconds."""),
- # GETTOR_TEXT[26]
+ # GETTOR_TEXT[25]
_("""6.) That's it. You're done. Thanks for using Tor and have fun!"""),
+ # GETTOR_TEXT[26]
+_("""SUPPORT
+======="""),
# GETTOR_TEXT[27]
-_("""SUPPORT"""),
- # GETTOR_TEXT[28]
_("""If you have any questions or it doesn't work, you can contact a
human at this support email address: tor-assistants at torproject.org"""),
- # GETTOR_TEXT[29]
+ # GETTOR_TEXT[28]
_(""" Here's your requested software as a zip file. Please unzip the
package and verify the signature."""),
+ # GETTOR_TEXT[29]
+_("""VERIFY SIGNATURE
+================
+If your computer has GnuPG installed, use the gpg commandline
+tool as follows after unpacking the zip file:
+
+ gpg --verify tor-browser-1.3.24_en-US.exe.asc tor-browser-1.3.24_en-US.exe"""),
# GETTOR_TEXT[30]
-_("""Hint: If your computer has GnuPG installed, use the gpg
-commandline tool as follows after unpacking the zip file:"""),
+_("""The output should look somewhat like this:
+
+ gpg: Good signature from 'Erinn Clark <...>'"""),
# GETTOR_TEXT[31]
-_("""The output should look somewhat like this:"""),
- # GETTOR_TEXT[32]
_("""If you're not familiar with commandline tools, try looking for
-a graphical user interface for GnuPG on this website:"""),
+a graphical user interface for GnuPG on this website:
+
+ http://www.gnupg.org/related_software/frontends.html"""),
+ # GETTOR_TEXT[32]
+_("""BLOCKED ACCESS / CENSORSHIP
+==========================="""),
# GETTOR_TEXT[33]
_("""If your Internet connection blocks access to the Tor network, you
may need a bridge relay. Bridge relays (or "bridges" for short)
@@ -519,7 +160,9 @@ connections to all the known Tor relays, they probably won't be able
to block all the bridges."""),
# GETTOR_TEXT[34]
_("""You can acquire a bridge by sending an email that contains "get bridges"
-in the body of the email to the following email address:"""),
+in the body of the email to the following email address:
+
+ bridges at torproject.org"""),
# GETTOR_TEXT[35]
_("""It is also possible to fetch bridges with a web browser at the following
url: https://bridges.torproject.org/"""),
@@ -537,7 +180,7 @@ _("""It was successfully understood. Your request is currently being processed.
Your package should arrive within the next ten minutes."""),
# GETTOR_TEXT[39]
_("""If it doesn't arrive, the package might be too big for your mail provider.
-Try resending the mail from a GMAIL.COM or YAHOO.COM account."""),
+Try resending the mail from a GMAIL.COM, YAHOO.CN or YAHOO.COM account."""),
# GETTOR_TEXT[40]
_("""Unfortunately we are currently experiencing problems and we can't fulfill
your request right now. Please be patient as we try to resolve this issue."""),
@@ -545,5 +188,89 @@ your request right now. Please be patient as we try to resolve this issue."""),
_("""Unfortunately there is no split package available for the package you
requested. Please send us another package name or request the same package
again, but remove the 'split' keyword. In that case we'll send you the whole
-package. Make sure this is what you want.""")
+package. Make sure this is what you want."""),
+ # GETTOR_TEXT[42]
+_("""UNPACKING THE FILES
+==================="""),
+ # GETTOR_TEXT[43]
+_("""To unpack the files you received, there's a number of alternatives on
+how to do it. The easiest way is to install 7-Zip, a free file compression/
+uncompression tool. If it isn't installed on your computer yet, you can
+download it here:
+
+ http://www.7-zip.org/"""),
+ # GETTOR_TEXT[44]
+_("""When 7-Zip is installed, you can open the .z archive you received from
+us by double-clicking on it."""),
+ # GETTOR_TEXT[45]
+_("""An alternative way to get the .z files extraced is to rename them to
+.zip. For example, if you recevied a file called "windows.z", rename it to
+"windows.zip". You should then be able to extract the archive with common
+file archiver programs that probably are already installed on your computer."""),
+ # GETTOR_TEXT[46]
+_("""Please reply to this mail, and tell me a single package name anywhere in
+the body of your email. To make your decision a bit easier, here's a
+short explanation of what these packages are:"""),
+ # GETTOR_TEXT[47]
+_("""windows:
+The Tor Browser Bundle package for Windows operating systems. If you're
+running some version of Windows, like Windows XP, Windows Vista or
+Windows 7, this is the package you should get."""),
+ # GETTOR_TEXT[48]
+_("""macos-i386:
+The Tor Browser Bundle package for OS X, Intel CPU architecture. In
+general, newer Mac hardware will require you to use this package."""),
+ # GETTOR_TEXT[49]
+_("""macos-ppc:
+This is a Vidalia Bundle for older Macs running OS X on PowerPC CPUs.
+Note that this package will be deprecated soon."""),
+ # GETTOR_TEXT[50]
+_("""linux-i386:
+The Tor Browser Bundle package for Linux, 32bit versions."""),
+ # GETTOR_TEXT[51]
+_("""Note that this package is rather large and needs your email provider to
+allow for attachments of about 30MB in size."""),
+ # GETTOR_TEXT[52]
+_("""linux-x86_64:
+The Tor Browser Bundle package for Linux, 64bit versions."""),
+ # GETTOR_TEXT[53]
+_("""source:
+The Tor source code. Only request this package if you know what you're
+doing. This isn't the package a normal user wants."""),
+ # GETTOR_TEXT[54]
+_("""FREQUENTLY ASKED QUESTIONS
+=========================="""),
+ # GETTOR_TEXT[55]
+_("""What is Tor?"""),
+ # GETTOR_TEXT[56]
+_("""The name "Tor" can refer to several different components."""),
+ # GETTOR_TEXT[57]
+_("""The Tor software is a program you can run on your computer that helps
+keep you safe on the Internet. Tor protects you by bouncing your
+communications around a distributed network of relays run by volunteers
+all around the world: it prevents somebody watching your Internet connection
+from learning what sites you visit, and it prevents the sites you visit from
+learning your physical location. This set of volunteer relays is called the
+Tor network. You can read more about how Tor works here:
+
+ https://www.torproject.org/about/overview.html.en"""),
+ # GETTOR_TEXT[58]
+_("""What is the Tor Browser Bundle?"""),
+ # GETTOR_TEXT[59]
+_("""The Browser Bundle (TBB) is the package we recommend to most users.
+The bundle comes with everything you need to safely browse the Internet.
+Just extract it and run."""),
+ # GETTOR_TEXT[60]
+_("""What package should I request?"""),
+ # GETTOR_TEXT[61]
+_("""This depends on the operating system you use. For instance, if your
+operating system is Microsoft Windows, you should request "windows". Here
+is a short explanation of all packages to request and what operating
+systems there are suitable for:"""),
+ # GETTOR_TEXT[62]
+_("""How do I extract the file(s) you sent me?"""),
+ # GETTOR_TEXT[63]
+_("""QUESTION:"""),
+ # GETTOR_TEXT[64]
+_("""ANSWER:""")
]
diff --git a/lib/gettor/packages.py b/lib/gettor/packages.py
index c5fa791..c3dbe65 100644
--- a/lib/gettor/packages.py
+++ b/lib/gettor/packages.py
@@ -131,8 +131,8 @@ class Packages:
self.rsync += " "
self.rsync += "--exclude='*privoxy*'"
self.rsync += " "
- self.rsync += "--exclude='*alpha*'"
- self.rsync += " "
+#self.rsync += "--exclude='*alpha*'"
+# self.rsync += " "
self.rsync += "--exclude='*torbutton*'"
self.rsync += " "
# Exclude tor-im bundles for now. Too large. XXX
@@ -140,8 +140,6 @@ class Packages:
self.rsync += " "
self.rsync += "--exclude='*win32*'"
self.rsync += " "
- self.rsync += "--exclude='*android*'"
- self.rsync += " "
self.rsync += "--exclude='*misc*'"
self.rsync += " "
if not silent:
diff --git a/lib/gettor/requests.py b/lib/gettor/requests.py
index 5b9bb3b..977b776 100644
--- a/lib/gettor/requests.py
+++ b/lib/gettor/requests.py
@@ -107,7 +107,7 @@ class requestMail:
"""If we find 'split' somewhere we assume that the user wants a split
delivery
"""
- match = re.match(".*split.*", line, re.DOTALL)
+ match = re.match("\s*split.*", line, re.DOTALL)
if match:
logging.debug("User requested a split delivery")
return True
diff --git a/lib/gettor/responses.py b/lib/gettor/responses.py
index b0dd643..bf1d2cb 100644
--- a/lib/gettor/responses.py
+++ b/lib/gettor/responses.py
@@ -18,92 +18,157 @@ from email.mime.text import MIMEText
import gettor.blacklist
import gettor.i18n as i18n
-def getPackageHelpMsg(t):
- return t.gettext(i18n.GETTOR_TEXT[0]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[6]) + "\n\n" \
- + """ tor-browser-bundle
- macosx-i386-bundle
- macosx-ppc-bundle
- linux-browser-bundle-i386
- linux-browser-bundle-x86_64
- source-bundle""" + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[7]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[8]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[9]) + "\n\n" \
- + " gettor+zh_CN at torproject.org" + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[10]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[11]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[12]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[13]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[14]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[15]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[16]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[17]) + "\n\n" \
- + " tor-browser-bundle" + "\n" \
- + " split" + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[18]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[19]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[20]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[21]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[22]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[23]) + "\n\n" \
- + " http://www.win-rar.com/download.html" + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[23]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[24]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[25]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[26]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[27]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[28]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[33]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[34]) + "\n\n" \
- + " bridges at torproject.org" + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[34]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[35]) + "\n"
-
+def getGreetingText(t):
+ return t.gettext(i18n.GETTOR_TEXT[0]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[1]) + "\n\n"
+
+def getPackageHelpText(t):
+ return t.gettext(i18n.GETTOR_TEXT[6]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[46]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[47]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[48]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[49]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[50]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[51]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[52]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[51]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[53]) + "\n\n"
+
+def getLocalizedVersionHelpText(t):
+ return t.gettext(i18n.GETTOR_TEXT[8]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[9]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[10]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[12]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[13]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[14]) + "\n\n"
+
+def getBridgesHelpText(t):
+ return t.gettext(i18n.GETTOR_TEXT[32]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[33]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[34]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[35]) + "\n\n"
+
+def getGeneralHelpText(t):
+ return getGreetingText(t) \
+ + getPackageHelpText(t) \
+ + getLocalizedVersionHelpText(t) \
+ + t.gettext(i18n.GETTOR_TEXT[15]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[16]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[17]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[18]) + "\n\n" \
+ + getBridgesHelpText(t) \
+ + getSupportText(t)
+
+def getFAQText(t):
+ return t.gettext(i18n.GETTOR_TEXT[54]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[63]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[55]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[64]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[56]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[57]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[63]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[58]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[64]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[59]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[63]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[60]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[64]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[61]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[47]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[48]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[49]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[50]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[51]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[52]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[53]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[63]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[62]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[64]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[43]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[44]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[45]) + "\n\n"
+
+def getSupportText(t):
+ return t.gettext(i18n.GETTOR_TEXT[26]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[27]) + "\n\n"
+
+def getSplitPackageText(t):
+ return t.gettext(i18n.GETTOR_TEXT[36]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[37]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[19]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[20]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[21]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[22]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[23]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[24]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[25]) + "\n\n"
+
+def getUnpackingText(t):
+ return t.gettext(i18n.GETTOR_TEXT[42]) + "\n" \
+ + t.gettext(i18n.GETTOR_TEXT[43]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[44]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[45]) + "\n\n" \
+
+def getVerifySignatureText(t):
+ return t.gettext(i18n.GETTOR_TEXT[29]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[30]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[31]) + "\n\n"
+
+def getInitialHelpMsg(t, config):
+ """Build a help string containing all languages we know.
+ """
+ help_text = ""
+ # Hello, dirty hack! Add "en", "fa", "zh_CN" hard-coded in the front
+ # as long as Python won't let us order out dict
+ t = i18n.getLang("en", config)
+ help_text += getGeneralHelpText(t)
+ help_text += "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n\n"
+ t = i18n.getLang("fa", config)
+ help_text += getGeneralHelpText(t)
+ help_text += "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n\n"
+ t = i18n.getLang("zh_CN", config)
+ help_text += getGeneralHelpText(t)
+ help_text += "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n\n"
+ for lang in config.SUPP_LANGS.keys():
+ # Hack continued: Skip "en", "fa", "zh_CN" -- because we have those
+ # already in
+ if lang == "en" or lang == "fa" or lang == "zh_CN":
+ continue
+ t = i18n.getLang(lang, config)
+ help_text += getGeneralHelpText(t)
+ help_text += "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n\n"
+ return help_text
+
def getPackageMsg(t):
- return t.gettext(i18n.GETTOR_TEXT[0]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[29]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[30]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[31]) + "\n\n" \
- + " gpg: Good signature from 'Erinn Clark <...>'" \
- + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[32]) + "\n\n" \
- + " http://www.gnupg.org/related_software/frontends.html" \
- + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[33]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[34]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[35]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[27]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[28]) + "\n"
+ return getGreetingText(t) \
+ + t.gettext(i18n.GETTOR_TEXT[28]) + "\n\n" \
+ + getVerifySignatureText(t) \
+ + getUnpackingText(t) \
+ + getBridgesHelpText(t) \
+ + getFAQText(t) \
+ + getSupportText(t)
def getSplitPackageMsg(t):
- return t.gettext(i18n.GETTOR_TEXT[0]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[36]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[37]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[19]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[20]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[21]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[22]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[23]) + "\n\n" \
- + " http://www.win-rar.com/download.html" + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[24]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[25]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[26]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[27]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[28]) + "\n"
+ return getGreetingText(t) \
+ + t.gettext(i18n.GETTOR_TEXT[28]) + "\n\n" \
+ + getSplitPackageText(t) \
+ + getUnpackingText(t) \
+ + getBridgesHelpText(t) \
+ + getFAQText(t) \
+ + getSupportText(t)
def getDelayAlertMsg(t):
- return t.gettext(i18n.GETTOR_TEXT[0]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[38]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[39]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[27]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[28]) + "\n"
+ return getGreetingText(t) \
+ + t.gettext(i18n.GETTOR_TEXT[38]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[39]) + "\n\n" \
+ + getSupportText(t)
def getNoSplitAvailable(t):
- return t.gettext(i18n.GETTOR_TEXT[0]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[41]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[27]) + "\n\n" \
- + t.gettext(i18n.GETTOR_TEXT[28]) + "\n"
+ return getGreetingText(t) \
+ + t.gettext(i18n.GETTOR_TEXT[1]) + "\n\n" \
+ + t.gettext(i18n.GETTOR_TEXT[41]) + "\n\n" \
+ + getSupportText(t)
+
class Response:
def __init__(self, config, reqInfo):
@@ -158,11 +223,11 @@ class Response:
"""
# First of all, check if user is whitelisted: Whitelist beats Blacklist
if self.wList.lookupListEntry(self.reqInfo['user'], "general"):
- logging.info("Whitelisted user " + self.reqInfo['user'])
+ logging.info("Whitelisted user " + self.reqInfo['hashed_user'])
return False
# Now check general and specific blacklists, in that order
if self.bList.lookupListEntry(self.reqInfo['user'], "general"):
- logging.info("Blacklisted user " + self.reqInfo['user'])
+ logging.info("Blacklisted user " + self.reqInfo['hashed_user'])
return True
# Create a unique dir name for the requested routine
self.bList.createSublist(fname)
@@ -291,6 +356,9 @@ class Response:
def sendHelp(self):
"""Send a help mail. This happens when a user sent us a request we
didn't really understand
+
+ XXX: This routine is currently not used, since we send out the
+ longer MULTILANGHELP message instead.
"""
if self.isBlacklistedForMessageType("sendHelp"):
# Don't send anything
@@ -306,7 +374,7 @@ class Response:
# Don't send anything
return False
logging.info("Sending package help to %s" % self.reqInfo['hashed_user'])
- return self.sendTextEmail(i18n.MULTILANGHELP)
+ return self.sendTextEmail(getInitialHelpMsg(self.t, self.config))
def sendTextEmail(self, text):
"""Generic text message sending routine.
More information about the tor-commits
mailing list