Changeset 4225
- Timestamp:
- 8 Jun 2009, 17:01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
waeup/branches/ulif-rewrite/src/waeup/datacenter.txt
r4191 r4225 142 142 to import data into instances of MyCSVReceiver: 143 143 144 >>> from waeup.csvfile.interfaces import ICSVFile 145 >>> from waeup.interfaces import IWAeUPCSVImporter 144 146 >>> from waeup.utils.importexport import CSVImporter 145 147 >>> class MyCSVImporter(CSVImporter): 146 ... grok.context(MyCSVReceiver) 148 ... grok.adapts(ICSVFile, MyCSVReceiver) 149 ... grok.provides(IWAeUPCSVImporter) 147 150 ... datatype = u'My Stuff' 148 ... column_terms = ['col1']149 151 ... def doImport(self, filepath, clear_old_data=True, 150 152 ... overwrite=True): … … 181 183 ----------------------------- 182 184 183 The examples above look complicated, but this is the price for185 The examples above looks complicated, but this is the price for 184 186 modularity. If you create a new container type, you can define an 185 187 importer and it will be used automatically by other components.
Note: See TracChangeset for help on using the changeset viewer.