Changeset 4801 for waeup


Ignore:
Timestamp:
14 Jan 2010, 09:07:09 (15 years ago)
Author:
uli
Message:

Add some interfaces for components we need for batch processing.

File:
1 edited

Legend:

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

    r4789 r4801  
    99from waeup.permissions import RoleSource
    1010
     11class FatalCSVError(Exception):
     12    """Some row could not be processed.
     13    """
     14    pass
     15
    1116def SimpleWAeUPVocabulary(*terms):
    1217    """A well-buildt vocabulary provides terms with a value, token and
     
    348353        `clear_old_data` is set to True.
    349354        """
    350        
     355
     356class IImporter(Interface):
     357    """A CSV file importer.
     358    """
     359    name = schema.TextLine(
     360        title = u'Importer name'
     361        )
     362
     363    mode = schema.Choice(
     364        title = u'Import mode',
     365        values = ['create', 'update', 'remove']
     366        )
     367   
     368    def doImport(path):
     369        """Read data from ``path`` and update connected object.
     370        """
     371
     372class ISchemaTypeConverter(Interface):
     373    """A converter for zope.schema.types.
     374    """
     375    def convert(string):
     376        """Convert string to certain schema type.
     377        """
     378
     379   
    351380class IUserAccount(IWAeUPObject):
    352381    """A user account.
Note: See TracChangeset for help on using the changeset viewer.