[FIX] web_linkedin: proper import of the web addons in embedded mode (otherwise it might clash with web.py).

bzr revid: vmt@openerp.com-20120809121537-z0pqr9c64bd1kcps
This commit is contained in:
Vo Minh Thu 2012-08-09 14:15:37 +02:00
parent af32150ad8
commit e8457bd914
1 changed files with 9 additions and 3 deletions

View File

@ -19,14 +19,20 @@
#
##############################################################################
import web.common.http
try:
# embedded
import openerp.addons.web.common.http as openerpweb
except ImportError:
# standalone
import web.common.http as openerpweb
import base64
import urllib2
class Binary(web.common.http.Controller):
class Binary(openerpweb.Controller):
_cp_path = "/web_linkedin/binary"
@web.common.http.jsonrequest
@openerpweb.jsonrequest
def url2binary(self, req,url):
bfile = urllib2.urlopen(url)
return base64.b64encode(bfile.read())