Commit 5eb0b580 authored by Alexandre Boeglin's avatar Alexandre Boeglin

replaced filter(lambda ...) by more readable list comprehension

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10705 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d9518434
...@@ -75,15 +75,14 @@ base_category_list = context.getVariationBaseCategoryList()\n ...@@ -75,15 +75,14 @@ base_category_list = context.getVariationBaseCategoryList()\n
for base_category in base_category_list:\n for base_category in base_category_list:\n
if matrixbox == 1:\n if matrixbox == 1:\n
# XXX matrixbox is right_display (not as listfield) => invert display and value in item\n # XXX matrixbox is right_display (not as listfield) => invert display and value in item\n
cell_range.append(map(lambda x: (x[1],x[0]), \n cell_range.append([(x[1], x[0]) for x in context.getVariationCategoryItemList(\n
context.getVariationCategoryItemList(\n base_category_list=(base_category,), display_base_category=1)])\n
base_category_list=(base_category,),\n
display_base_category=1)))\n
else:\n else:\n
cell_range.append(context.getVariationCategoryList(\n cell_range.append(context.getVariationCategoryList(\n
base_category_list=(base_category,)))\n base_category_list=(base_category,)))\n
\n \n
cell_range = filter(lambda x: x != [], cell_range )\n cell_range = [x for x in cell_range if x != []]\n
\n
\n \n
return cell_range\n return cell_range\n
\n \n
...@@ -188,8 +187,10 @@ return cell_range\n ...@@ -188,8 +187,10 @@ return cell_range\n
<string>base_category_list</string> <string>base_category_list</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>base_category</string> <string>base_category</string>
<string>map</string> <string>append</string>
<string>filter</string> <string>$append0</string>
<string>x</string>
<string>_getitem_</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -317,7 +317,7 @@ ...@@ -317,7 +317,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: here.getVariationBaseCategoryList()</string> </value> <value> <string>here/getVariationBaseCategoryList</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
4 7
\ 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