diff options
author | Anton Khirnov <anton@khirnov.net> | 2021-01-26 10:26:27 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2021-01-26 10:29:24 +0100 |
commit | 5cb88d559ae462dad80d346d44f12dcc9eb3ec10 (patch) | |
tree | d6971568c4f026be6ccdf6d93042c5d0c2770acc /alot/helper.py | |
parent | 6a22c9f8026f255c5e6eed5916168552138581e2 (diff) |
Rewrite mailcap handling.
Add a class that encapsulates the handler and is responsible for
managing the temporary file, if one is needed.
Use this class for both rendering inline content and displaying
attachments externally.
External attachments are now wrapped in an asyncio task that is added to
a pool of tasks managed by ui.
Diffstat (limited to 'alot/helper.py')
-rw-r--r-- | alot/helper.py | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/alot/helper.py b/alot/helper.py index 27652988..9ba3c411 100644 --- a/alot/helper.py +++ b/alot/helper.py @@ -378,19 +378,6 @@ def shell_quote(text): return "'%s'" % text.replace("'", """'"'"'""") -def parse_mailcap_nametemplate(tmplate='%s'): - """this returns a prefix and suffix to be used - in the tempfile module for a given mailcap nametemplate string""" - nt_list = tmplate.split('%s') - template_prefix = '' - template_suffix = '' - if len(nt_list) == 2: - template_suffix = nt_list[1] - template_prefix = nt_list[0] - else: - template_suffix = tmplate - return (template_prefix, template_suffix) - def get_xdg_env(env_name, fallback): """ Used for XDG_* env variables to return fallback if unset *or* empty """ env = os.environ.get(env_name) |