summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-includes/etc/whisperback/config.py
diff options
context:
space:
mode:
Diffstat (limited to 'config/chroot_local-includes/etc/whisperback/config.py')
-rw-r--r--config/chroot_local-includes/etc/whisperback/config.py61
1 files changed, 33 insertions, 28 deletions
diff --git a/config/chroot_local-includes/etc/whisperback/config.py b/config/chroot_local-includes/etc/whisperback/config.py
index fe5bc85..32ee87d 100644
--- a/config/chroot_local-includes/etc/whisperback/config.py
+++ b/config/chroot_local-includes/etc/whisperback/config.py
@@ -18,6 +18,7 @@ import gettext
# DOCUMENTATION
+
def __get_localised_doc_link():
"""Return the link to the localised documentation
@@ -49,18 +50,20 @@ def __get_localised_doc_link():
localised_doc_language = 'en'
return ("file:///usr/share/doc/tails/website/doc/first_steps/bug_reporting." +
- localised_doc_language +
- ".html")
+ localised_doc_language +
+ ".html")
+
def _(string):
try:
encoded = gettext.translation("tails", "/usr/share/locale").lgettext(string)
- string = encoded.decode('utf-8')
+ string = encoded.decode('utf-8')
except IOError:
pass
finally:
return string
+
# The right panel help (HTML string)
html_help = _(
"""<h1>Help us fix your bug!</h1>
@@ -92,7 +95,7 @@ gnupg_keyring = "/usr/share/keyrings/whisperback-keyring.gpg"
# The address of the recipient
to_address = "tails-bugs@boum.org"
-# The fingerprint of the recipient's GPG key
+# The fingerprint of the recipient's GPG key
to_fingerprint = "1F56EDD30741048035DAC1C5EC57B56EF0C43132"
# SENDER
@@ -132,47 +135,49 @@ socks_port = 9062
# Please take into account that this will not be encrypted
mail_subject = "Bug report: %x" % random.randrange(16**32)
-# A callback function to get information to prepend to the mail
-# (this information will be encrypted). This is useful to add
-# software version.
-#
-# It should not take any parameter, and should return a string to be
-# preprended to the email
+
def mail_prepended_info():
"""Returns the version of the running Tails system
-
+ A callback function to get information to prepend to the mail
+ (this information will be encrypted). This is useful to add
+ software version.
+
+ It should not take any parameter, and should return a string to be
+ preprended to the email
+
@return The output of tails-version, if any, or an English string
explaining the error
"""
-
+
try:
- tails_version_process = subprocess.Popen ("tails-version",
+ tails_version_process = subprocess.Popen("tails-version",
stdout=subprocess.PIPE)
- tails_version_process.wait()
- tails_version = tails_version_process.stdout.read().decode('utf-8')
+ tails_version_process.wait()
+ tails_version = tails_version_process.stdout.read().decode('utf-8')
except OSError:
- tails_version = "tails-version command not found"
+ tails_version = "tails-version command not found"
except subprocess.CalledProcessError:
- tails_version = "tails-version returned an error"
-
+ tails_version = "tails-version returned an error"
+
return "Tails-Version: %s\n" % tails_version
-# A callback function to get information to append to the email
-# (this information will be encrypted). This is useful to add
-# configuration files useful for debugging.
-#
-# It should not take any parameter, and should return a string to be
-# appended to the email
+
def mail_appended_info():
"""Returns debugging information on the running Tails system
-
- @return a long string containing debugging information
+ A callback function to get information to append to the email
+ (this information will be encrypted). This is useful to add
+ configuration files useful for debugging.
+
+ It should not take any parameter, and should return a string serialized
+ json to be deserialized to append infos to the email
+
+ @return a string containing serialized json with debugging information
"""
debugging_info = ""
try:
- process = subprocess.Popen (["sudo", "/usr/local/sbin/tails-debugging-info"],
- stdout=subprocess.PIPE)
+ process = subprocess.Popen(["sudo", "/usr/local/sbin/tails-debugging-info"],
+ stdout=subprocess.PIPE)
for line in process.stdout:
debugging_info += re.sub(r'^--\s*', '', line.decode('utf-8'))
process.wait()