Changeset 4150


Ignore:
Timestamp:
20 May 2009, 07:57:41 (16 years ago)
Author:
uli
Message:

Add simple interfaces for CSV import/export.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • waeup/branches/ulif-rewrite/src/waeup/interfaces.py

    r4131 r4150  
    117117        """
    118118
     119class IWAeUPCSVExporter(Interface):
     120    """A CSV exporter for objects.
     121    """
     122    def export(obj, filepath=None):
     123        """Export as CSV.
     124
     125        Returns a CSV representation of `obj`.
     126
     127        If `filepath` is ``None``, a StringIO` object is returned,
     128        that contains the transformed data.
     129        """
     130
     131class IWAeUPCSVImporter(Interface):
     132    """A CSV importer for objects.
     133    """
     134    def doImport(filepath):
     135        """Read data from `filepath` and apply data.
     136
     137        It depends on the context, what 'applying data' means here.
     138        """
     139
    119140class IUserAccount(IWAeUPObject):
    120141    """A user account.
Note: See TracChangeset for help on using the changeset viewer.