Commit 992dc663 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

2010-11-15 Kazuhiko

* improve Document_getStandardFileName so that the extention in the original filename will be used as the fallback.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40260 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8d80220b
......@@ -64,15 +64,18 @@ elif context.hasSourceReference():\n
file_name = context.getSourceReference()\n
else:\n
file_name = context.getTitleOrId()\n
original_extension = None\n
extension = None\n
if \'.\' in file_name:\n
file_name, original_extension = file_name.rsplit(\'.\', 1)\n
file_name, extension = file_name.rsplit(\'.\', 1)\n
if context.getVersion():\n
file_name = \'%s-%s\' % (file_name, context.getVersion(),)\n
if context.getLanguage():\n
file_name = \'%s-%s\' % (file_name, context.getLanguage(),)\n
if format or original_extension:\n
extension = (format or original_extension).split(\'.\')[-1]\n
if format:\n
extension = format.rsplit(\'.\')[-1]\n
elif not extension and context.hasSourceReference():\n
extension = context.getSourceReference().rsplit(\'.\')[-1]\n
if extension:\n
file_name = \'%s.%s\' % (file_name, extension,)\n
return file_name\n
</string> </value>
......@@ -116,10 +119,9 @@ return file_name\n
<string>context</string>
<string>file_name</string>
<string>None</string>
<string>original_extension</string>
<string>extension</string>
<string>_getiter_</string>
<string>_getitem_</string>
<string>extension</string>
</tuple>
</value>
</item>
......
2010-11-15 Kazuhiko
* improve Document_getStandardFileName so that the extention in the original filename will be used as the fallback.
2010-10-13 yo
* Drop Decimal Exponent and change Precision to a Float Field (through Proxy Field) in the view of Rounding Model.
......
896
\ No newline at end of file
897
\ 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