[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:
parent
af32150ad8
commit
e8457bd914
|
@ -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 base64
|
||||||
import urllib2
|
import urllib2
|
||||||
|
|
||||||
class Binary(web.common.http.Controller):
|
class Binary(openerpweb.Controller):
|
||||||
_cp_path = "/web_linkedin/binary"
|
_cp_path = "/web_linkedin/binary"
|
||||||
|
|
||||||
@web.common.http.jsonrequest
|
@openerpweb.jsonrequest
|
||||||
def url2binary(self, req,url):
|
def url2binary(self, req,url):
|
||||||
bfile = urllib2.urlopen(url)
|
bfile = urllib2.urlopen(url)
|
||||||
return base64.b64encode(bfile.read())
|
return base64.b64encode(bfile.read())
|
||||||
|
|
Loading…
Reference in New Issue