Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
GenericSetup.content.CSVAwareFileAdapter Class Reference

List of all members.

Public Member Functions

def __init__
def export
def listExportableItems
def import_

Public Attributes

 context

Detailed Description

Adapter for content whose "natural" representation is CSV.

Definition at line 247 of file content.py.


Constructor & Destructor Documentation

Definition at line 252 of file content.py.

00252 
00253     def __init__(self, context):
00254         self.context = context


Member Function Documentation

def GenericSetup.content.CSVAwareFileAdapter.export (   self,
  export_context,
  subdir,
  root = False 
)
See IFilesystemExporter.

Definition at line 255 of file content.py.

00255 
00256     def export(self, export_context, subdir, root=False):
00257         """ See IFilesystemExporter.
00258         """
00259         export_context.writeDataFile('%s.csv' % self.context.getId(),
00260                                      self.context.as_csv(),
00261                                      'text/comma-separated-values',
00262                                      subdir,
00263                                     )

def GenericSetup.content.CSVAwareFileAdapter.import_ (   self,
  import_context,
  subdir,
  root = False 
)
See IFilesystemImporter.

Definition at line 269 of file content.py.

00269 
00270     def import_(self, import_context, subdir, root=False):
00271         """ See IFilesystemImporter.
00272         """
00273         cid = self.context.getId()
00274         data = import_context.readDataFile('%s.csv' % cid, subdir)
00275         if data is None:
00276             logger = import_context.getLogger('CSAFA')
00277             logger.info('no .csv file for %s/%s' % (subdir, cid))
00278         else:
00279             stream = StringIO(data)
00280             self.context.put_csv(stream)

See IFilesystemExporter.

Definition at line 264 of file content.py.

00264 
00265     def listExportableItems(self):
00266         """ See IFilesystemExporter.
00267         """
00268         return ()


Member Data Documentation

Definition at line 253 of file content.py.


The documentation for this class was generated from the following file: