return buffer.getvalue ()
+def txt(msg):
+ text = msg
+ if not isinstance(msg, unicode):
+ text = unicode (msg, "utf-8")
+ return text
+
def export_ods (headers, data):
doc = OpenDocumentSpreadsheet()
style = Style(name="Large number", family="table-cell")
for item in headers:
tc = TableCell ()
tr.addElement (tc)
- p = P(stylename = style, text = unicode (item, "utf-8"))
+ p = P(stylename = style, text = txt(item))
tc.addElement (p)
for line in data:
for item in line:
tc = TableCell ()
tr.addElement (tc)
- p = P (stylename = style, text = unicode (item, "utf-8"))
+ p = P (stylename = style, text = txt(item))
tc.addElement (p)
doc.spreadsheet.addElement(table)
from setuptools import setup
-version = '1.0'
+version = '1.0.1'
setup(
- name='django_exportateur',
+ name='django-exportateur',
version=version,
- description="Outils d'exportation en csv/ods",
+ description="Outils d'exportation en csv/ods (test nom package)",
long_description="""
""",
keywords='django, export, csv, ods',
author='Cyril Robert',
author_email='cyril.robert@auf.org',
license='GPL',
- packages=['django_exportateur'],
- package_dir={'django_exportateur': 'django_exportateur'},
+ packages=['django-exportateur'],
+ package_dir={'django-exportateur': 'django_exportateur'},
include_package_data=True,
zip_safe=True,
install_requires=['django', 'odfpy'],