Commit fc085f12 authored by Kevin Deldycke's avatar Kevin Deldycke

Better handling of empty list


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4560 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9c82531e
...@@ -80,10 +80,11 @@ code_list = []\n ...@@ -80,10 +80,11 @@ code_list = []\n
# sort the category list lexicographically\n # sort the category list lexicographically\n
# this prevents us to choose the exact order we want,\n # this prevents us to choose the exact order we want,\n
# but also prevents some human mistake to f*ck everything up by creating site_function instead of function_site\n # but also prevents some human mistake to f*ck everything up by creating site_function instead of function_site\n
category_list = []\n if category_order not in (None, \'\'):\n
if category_order not in (None, \'\', (), []):\n category_order = [ x for x in category_order]\n
category_list = [ x for x in category_order]\n category_order.sort()\n
category_order = category_list.sort()\n else:\n
category_order = []\n
\n \n
for base_category in category_order:\n for base_category in category_order:\n
category = kw[base_category]\n category = kw[base_category]\n
...@@ -99,29 +100,28 @@ return \'_\'.join(code_list)\n ...@@ -99,29 +100,28 @@ return \'_\'.join(code_list)\n
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
<value> <string encoding="base64">YwAAAAAAAAAAAQAAAEAAAABzDQAAAGQBAIQAAFoAAGQAAFMoAgAAAE5jAQAAABEAAAARAAAASwAA <value> <string encoding="base64">YwAAAAAAAAAAAQAAAEAAAABzDQAAAGQBAIQAAFoAAGQAAFMoAgAAAE5jAQAAABAAAAAOAAAASwAA
AHMvAQAAZwAAfQIAZwAAfQMAfAAAdAMAZAEAZgAAZwAAZgQAagcAbzEAAWcAAARpBAB9BgB0BgB8 AHMnAQAAZwAAfQIAfAAAdAIAZAEAZgIAagcAb0EAAWcAAARpAwB9BQB0BQB8AACDAQBEXRAAfQcA
AACDAQBEXRAAfQgAfAYAfAgAgwEAAXE5AH4GAH0DAG4BAAF0CAB8AwBkAgCDAgCDAAB9AAB4rQB0 fAUAfAcAgwEAAXEtAH4FAH0AAHQHAHwAAGQCAIMCAIMAAAFuBwABZwAAfQAAeK0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CAAAAGNhdGVnb3J5cw0AAABjYXRlZ29yeV9wYXRocwcAAABjb250ZXh0cw8AAABj
Y2F0ZWdvcnlzDQAAAGNhdGVnb3J5X3BhdGhzBwAAAGNvbnRleHRzDwAAAGNhdGVnb3J5X29iamVj YXRlZ29yeV9vYmplY3RzDQAAAGNhdGVnb3J5X2NvZGUoAAAAACgAAAAAcw8AAABTY3JpcHQgKFB5
dHMNAAAAY2F0ZWdvcnlfY29kZSgAAAAAKAAAAABzDwAAAFNjcmlwdCAoUHl0aG9uKXMaAAAARVJQ dGhvbilzGgAAAEVSUDVUeXBlX2FzU2VjdXJpdHlHcm91cElkAQAAAHMgAAAAAAkGBRMBFAAcAREC
NVR5cGVfYXNTZWN1cml0eUdyb3VwSWQBAAAAcyAAAAAACQYFBgEZARQAHQESAg0ABgEPARABHgET BgINAAYBDwEQAR4BEwERASgBFAIoAQAAAHMaAAAARVJQNVR5cGVfYXNTZWN1cml0eUdyb3VwSWQo
AREBKAEUAigBAAAAcxoAAABFUlA1VHlwZV9hc1NlY3VyaXR5R3JvdXBJZCgBAAAAcxoAAABFUlA1 AQAAAHMaAAAARVJQNVR5cGVfYXNTZWN1cml0eUdyb3VwSWQoAAAAACgAAAAAcw8AAABTY3JpcHQg
VHlwZV9hc1NlY3VyaXR5R3JvdXBJZCgAAAAAKAAAAABzDwAAAFNjcmlwdCAoUHl0aG9uKXMIAAAA KFB5dGhvbilzCAAAADxtb2R1bGU+AQAAAHMAAAAA</string> </value>
PG1vZHVsZT4BAAAAcwAAAAA=</string> </value>
</item> </item>
<item> <item>
<key> <string>_filepath</string> </key> <key> <string>_filepath</string> </key>
...@@ -158,7 +158,6 @@ PG1vZHVsZT4BAAAAcwAAAAA=</string> </value> ...@@ -158,7 +158,6 @@ PG1vZHVsZT4BAAAAcwAAAAA=</string> </value>
<string>category_order</string> <string>category_order</string>
<string>kw</string> <string>kw</string>
<string>code_list</string> <string>code_list</string>
<string>category_list</string>
<string>None</string> <string>None</string>
<string>append</string> <string>append</string>
<string>$append0</string> <string>$append0</string>
......
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