diff --git a/tryton/tryton/common/__init__.py b/tryton/tryton/common/__init__.py index 5349c5d0ec..e34fb38043 100644 --- a/tryton/tryton/common/__init__.py +++ b/tryton/tryton/common/__init__.py @@ -10,7 +10,7 @@ from .common import ( file_write, filter_domain, generateColorscheme, get_align, get_credentials, get_gdk_backend, get_hostname, get_monitor_size, get_port, get_sensible_widget, get_toplevel_window, hex2rgb, highlight_rgb, humanize, - idle_add, mailto, message, node_attributes, open_documentation, play_sound, + idle_add, message, node_attributes, open_documentation, play_sound, process_exception, resize_pixbuf, selection, setup_window, slugify, sur, sur_3b, timezoned_date, to_xml, untimezoned_date, url_open, userwarning, warning) @@ -70,7 +70,6 @@ __all__ = [ idle_add, inverse_leaf, localize_domain, - mailto, merge, message, node_attributes, diff --git a/tryton/tryton/common/common.py b/tryton/tryton/common/common.py index 480c0fe4d6..509946fc35 100644 --- a/tryton/tryton/common/common.py +++ b/tryton/tryton/common/common.py @@ -25,7 +25,6 @@ try: except ImportError: from http import client as HTTPStatus -import shlex import socket import sys import traceback @@ -35,7 +34,6 @@ import urllib.request import webbrowser import zipfile from functools import wraps -from string import Template from threading import Lock, Thread from gi.repository import Gdk, GdkPixbuf, Gio, GLib, GObject, Gtk @@ -684,52 +682,6 @@ def url_open(uri): raise -def mailto(to=None, cc=None, subject=None, body=None, attachment=None): - if CONFIG['client.email']: - cmd = Template(CONFIG['client.email']).substitute( - to=to or '', - cc=cc or '', - subject=subject or '', - body=body or '', - attachment=attachment or '', - ) - args = shlex.split(str(cmd)) - subprocess.Popen(args) - return - if os.name != 'nt' and sys.platform != 'darwin': - args = ['xdg-email', '--utf8'] - if cc: - args.extend(['--cc', cc]) - if subject: - args.extend(['--subject', subject]) - if body: - args.extend(['--body', body]) - if attachment: - args.extend(['--attach', attachment]) - if to: - args.append(to) - try: - subprocess.Popen(args) - return - except OSError: - pass - # http://www.faqs.org/rfcs/rfc2368.html - url = "mailto:" - if to: - url += urllib.parse.quote(to.strip(), "@,") - url += '?' - if cc: - url += "&cc=" + urllib.parse.quote(cc, "@,") - if subject: - url += "&subject=" + urllib.parse.quote(subject, "") - if body: - body = "\r\n".join(body.splitlines()) - url += "&body=" + urllib.parse.quote(body, "") - if attachment: - url += "&attachment=" + urllib.parse.quote(attachment, "") - webbrowser_open(url, new=1) - - class UniqueDialog(object): def __init__(self): diff --git a/tryton/tryton/config.py b/tryton/tryton/config.py index 99b901db67..0bcac92d46 100644 --- a/tryton/tryton/config.py +++ b/tryton/tryton/config.py @@ -90,7 +90,6 @@ class ConfigManager(object): 'client.code_scanner_sound': True, 'client.lang': locale.getdefaultlocale()[0], 'client.language_direction': 'ltr', - 'client.email': '', 'client.limit': 1000, 'client.check_version': True, 'client.bus_timeout': 10 * 60,