Commit f6ad824d authored by Aurel's avatar Aurel

take new syncml parameter into account

parent 161eae5e
...@@ -127,41 +127,42 @@ for table_name in spreadsheet_list.keys():\n ...@@ -127,41 +127,42 @@ for table_name in spreadsheet_list.keys():\n
property_map[column_index] = column_id\n property_map[column_index] = column_id\n
column_index += 1\n column_index += 1\n
# This path_element_list help us to reconstruct the absolute path\n # This path_element_list help us to reconstruct the absolute path\n
context.log("line_id = %r" %(line_id))\n
if line_id is not None:\n if line_id is not None:\n
line_list = [sheet[int(line_id)-1],]\n line_list = [sheet[int(line_id)-1],]\n
line_index = int(line_id)\n line_index = int(line_id)\n
else:\n else:\n
line_list = sheet[1:]\n line_list = sheet[1:]\n
line_index = 2\n line_index = 2\n
context.log(\'line_list = %s\' %(line_list))\n line_list = line_list[:limit]\n
for line in line_list:\n for line in line_list:\n
if id_list and str(line_index) not in id_list:\n
continue\n
# Exclude empty lines\n # Exclude empty lines\n
context.log("\\tgot line", line)\n
if line.count(\'\') + line.count(None) == len(line):\n if line.count(\'\') + line.count(None) == len(line):\n
continue\n continue\n
\n \n
# Prefetch line datas\n # Prefetch line datas\n
line_data = {"id" : str(line_index)}\n line_data = {"id" : str(line_index)}\n
path_defined = []\n if not id_only:\n
for cell_index, cell in enumerate(line):\n path_defined = []\n
# Get the property corresponding to the cell data\n for cell_index, cell in enumerate(line):\n
property_id = property_map[cell_index]\n # Get the property corresponding to the cell data\n
if cell is not None and cell.strip()==\'\':\n property_id = property_map[cell_index]\n
# empty string is NOT a valid identifier\n if cell is not None and cell.strip()==\'\':\n
cell=None\n # empty string is NOT a valid identifier\n
if not cell:\n cell=None\n
continue\n if not cell:\n
if line_data.has_key(property_id):\n continue\n
if isinstance(line_data[property_id], str):\n if line_data.has_key(property_id):\n
cell_value_list = [line_data[property_id], cell]\n if isinstance(line_data[property_id], str):\n
line_data[property_id] = cell_value_list\n cell_value_list = [line_data[property_id], cell]\n
line_data[property_id] = cell_value_list\n
else:\n
line_data[property_id].append(cell)\n
else:\n else:\n
line_data[property_id].append(cell)\n line_data[property_id] = cell\n
else:\n # Proceed to next cell\n
line_data[property_id] = cell\n cell_index += 1\n
# Proceed to next cell\n
cell_index += 1\n
line_index += 1\n line_index += 1\n
spreadsheet_line_list.append(line_data)\n spreadsheet_line_list.append(line_data)\n
\n \n
...@@ -172,7 +173,7 @@ return spreadsheet_line_list\n ...@@ -172,7 +173,7 @@ return spreadsheet_line_list\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>reference, table, line_id=None</string> </value> <value> <string>reference, table, limit, id_only, line_id=None, id_list=None</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
1 2
\ 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