# -*- coding: UTF-8 -*-
# Copyright (C) 2009 Itaapy, ArsAperta, Pierlis, Talend

# Import from the Standard Library
from glob import glob

# Import from lpod
from lpod.document import odf_new_document_from_type
from lpod.table import create_table_from_csv

# Get elements
document = odf_new_document_from_type('spreadsheet')
body = document.get_body()

# Delete the 3 default sheets
body.clear()

for id, csv_name in enumerate(glob('./files/*.csv')):
    tab = create_table_from_csv(u'tab_%s' % id , csv_name)
    body.append_element(tab)

# Save
document.save('spreadsheet.ods', pretty=True)



@@ -227,28 +227,22 @@
  import 
-create_table
+import
 _from_cs
@@ -392,20 +392,20 @@
 for id, 
-csv_
+file
 name in 
@@ -449,59 +449,147 @@
  tab
+le
  = 
-create_table_from_csv(u'tab_
+import_from_csv(filename, u'Table 
 %25s' %25 
+(
 id 
-, csv_name)
++ 1))%0A    # Table is represented as a matrix in memory,%0A    # so ask to reformat it to XML
 %0A   
@@ -612,16 +612,35 @@
 ment(tab
+le.to_odf_element()
 )%0A%0A# Sav
@@ -687,10 +687,8 @@
 y=True)%0A
-%0A%0A

fix and update ods example