From ebde563d056eebd30c0d3f7a329fee442da57d7a Mon Sep 17 00:00:00 2001 From: "nch@tinyerp.com" <> Date: Wed, 5 May 2010 19:01:47 +0530 Subject: [PATCH] [IMP]:gtk contact form bzr revid: nch@tinyerp.com-20100505133147-9lpdgkf1tn75v8ws --- bin/tools/misc.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/bin/tools/misc.py b/bin/tools/misc.py index 7aee1aed1b0..e552660e3e2 100644 --- a/bin/tools/misc.py +++ b/bin/tools/misc.py @@ -33,6 +33,8 @@ import release import socket import re from itertools import islice +import threading + if sys.version_info[:2] < (2, 4): from threadinglocal import local @@ -472,7 +474,7 @@ def email_send(email_from, email_to, subject, body, email_cc=None, email_bcc=Non for key, value in x_headers.iteritems(): msg['X-OpenERP-%s' % key] = str(value) msg['%s' % key] = str(value) - + if openobject_id: msg['Message-Id'] = "<%s-openobject-%s@%s>" % (time.time(), openobject_id, socket.gethostname()) @@ -1284,6 +1286,23 @@ if __name__ == '__main__': import doctest doctest.testmod() +class upload_data_thread(threading.Thread): + def __init__(self, email, data, type): + self.args = [('email',email),('type',type),('data',data)] + super(upload_data_thread,self).__init__() + def run(self): + try: + import urllib + args = urllib.urlencode(self.args) + fp = urllib.urlopen('http://www.openerp.com/scripts/survey.php', args) + fp.read() + fp.close() + except: + pass +def upload_data(email, data, type='SURVEY'): + a = upload_data_thread(email, data, type) + a.start() + return True # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: