Commit a2e14c11 authored by lamby's avatar lamby
Browse files

Add a wrapper around Liferea to display a deprecation warning. (#11082)

parent 06e1f3a6
#!/usr/bin/env python3
"""
Tails Liferea wrapper
"""
import os
import sh
import sys
from gettext import gettext
LIFEREA = '/usr/bin/liferea'
os.environ['TEXTDOMAIN'] = 'tails'
def main():
disabled_text = gettext('Liferea is deprecated')
question_text = gettext('Do you wish to start Liferea anyway?')
warning_text = gettext(
"Due to security concerns the Liferea RSS reader from a future "
"version of Tails. Please migrate your feeds to Thunderbird."
)
dialog_msg = '<b><big>{}</big></b>\n\n{}\n\n{}\n'.format(
disabled_text,
warning_text,
question_text,
)
exit_text = gettext('_Exit')
launch_text = gettext('_Launch')
# results 0 == True; 1 == False; 5 == Timeout
results = sh.zenity(
'--question',
'--title', '',
'--default-cancel',
'--ok-label', launch_text,
'--cancel-label', exit_text,
'--text', dialog_msg,
_ok_code=[0, 1, 5],
)
if results.exit_code != 0:
return 1
return os.execv(LIFEREA, [LIFEREA] + sys.argv[1:])
if __name__ == '__main__':
sys.exit(main(*sys.argv[1:]))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment