Commit 2807d723 authored by Ivan Tyagov's avatar Ivan Tyagov

Use existing API to check if converting to base format is supported or not...

Use existing API to check if converting to base format is supported or not (rather than relying on dynamic method introspection).

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35390 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 93cc175f
...@@ -54,14 +54,14 @@ ...@@ -54,14 +54,14 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string>"""\n
This is a convenient method to call both convertToBaseFormat and\n This is a convenient method to call both convertToBaseFormat and\n
discoverMetadata in good order in the same transaction. This method\n discoverMetadata in good order in the same transaction. \n
guarantees order of calling methods. convertToBaseFormat is called first,\n This method guarantees order of calling methods.\n
and discoverMetadata is called after.\n
"""\n """\n
convertToBaseFormat = getattr(context, \'convertToBaseFormat\', None)\n \n
if convertToBaseFormat is not None:\n if context.isSupportBaseDataConversion():\n
convertToBaseFormat()\n context.convertToBaseFormat()\n
\n
return context.discoverMetadata(file_name, user_login)\n return context.discoverMetadata(file_name, user_login)\n
</string> </value> </string> </value>
</item> </item>
...@@ -101,11 +101,8 @@ return context.discoverMetadata(file_name, user_login)\n ...@@ -101,11 +101,8 @@ return context.discoverMetadata(file_name, user_login)\n
<tuple> <tuple>
<string>file_name</string> <string>file_name</string>
<string>user_login</string> <string>user_login</string>
<string>getattr</string>
<string>context</string>
<string>None</string>
<string>convertToBaseFormat</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
93 94
\ No newline at end of file \ No newline at end of file
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