Commit f062347a authored by Bartek Górny's avatar Bartek Górny

handle value returned by object

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9211 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1dd4e15b
......@@ -68,7 +68,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># determine content type\n
<value> <string encoding="cdata"><![CDATA[
# determine content type\n
ctype=context.content_type_registry.findTypeName(fname,None,None)\n
context.log(fname,ctype)\n
if ctype is None:\n
......@@ -78,9 +80,13 @@ if ctype is None:\n
ob=context.document_module.newContent(portal_type=ctype,file=data)\n
ob.setOriginalFilename(fname)\n
ob.guessMimeType(fname)\n
ob.convert() # to be changed - OOoDocument needs refactoring\n
code,msg=ob.convert()\n
if code>0:\n
raise Exception(msg)\n
return ob\n
</string> </value>
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -125,11 +131,14 @@ return ob\n
<string>fname</string>
<string>data</string>
<string>_getattr_</string>
<string>context</string>
<string>context</string>
<string>None</string>
<string>ctype</string>
<string>Exception</string>
<string>ob</string>
<string>_getiter_</string>
<string>code</string>
<string>msg</string>
</tuple>
</value>
</item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment