[IMP]pad : fix the pad issue
bzr revid: mma@tinyerp.com-20121029131938-0k92cijgqorcnjnh
This commit is contained in:
+9
-4
@@ -8,6 +8,8 @@ from tools.translate import _
|
||||
from openerp.tools.misc import html2plaintext
|
||||
from py_etherpad import EtherpadLiteClient
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
class pad_common(osv.osv_memory):
|
||||
_name = 'pad.common'
|
||||
|
||||
@@ -59,10 +61,13 @@ class pad_common(osv.osv_memory):
|
||||
def pad_get_content(self, cr, uid, url, context=None):
|
||||
content = ''
|
||||
if url:
|
||||
page = urllib2.urlopen('%s/export/html'%url).read()
|
||||
mo = re.search('<body>(.*)</body>',page)
|
||||
if mo:
|
||||
content = mo.group(1)
|
||||
try:
|
||||
page = urllib2.urlopen('%s/export/html'%url).read()
|
||||
mo = re.search('<body>(.*)</body>',page)
|
||||
if mo:
|
||||
content = mo.group(1)
|
||||
except:
|
||||
_logger.warning("No url found '%s'.", url)
|
||||
return content
|
||||
|
||||
# TODO
|
||||
|
||||
Reference in New Issue
Block a user