Index: main/waeup.sirp/trunk/src/waeup/sirp/datacenter.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/datacenter.py	(revision 4960)
+++ main/waeup.sirp/trunk/src/waeup/sirp/datacenter.py	(revision 4961)
@@ -7,13 +7,9 @@
 import os
 import shutil
-import struct
 import grok
 from datetime import datetime
-from zope.component import getMultiAdapter
 from zope.component.interfaces import ObjectEvent
-from waeup.sirp.csvfile import getCSVFile
-from waeup.sirp.interfaces import (IDataCenter, IWAeUPCSVImporter,
-                              ICSVDataReceivers, IDataCenterFile,
-                              IDataCenterStorageMovedEvent)
+from waeup.sirp.interfaces import (IDataCenter, IDataCenterFile,
+                                   IDataCenterStorageMovedEvent)
 from waeup.sirp.utils.helpers import copyFileSystemTree
 
@@ -73,47 +69,4 @@
         return
     
-    def getReceivers(self):
-        receivers = []
-        curr_obj = getattr(self, '__parent__', None)
-        while curr_obj is not None:
-            if ICSVDataReceivers.providedBy(curr_obj):
-                receivers = self.getCSVDataReceivers(curr_obj)
-                break
-            curr_obj = getattr(curr_obj, '__parent__', None)
-        return receivers
-
-    def getReceiverIds(self):
-        """Get a dict of available receivers.
-
-        The keys of the result are the receiver ids.
-        """
-        receivers = self.getReceivers()
-        return dict([(self.getReceiverId(x), x) for x in receivers])
-    
-    def getImporters(self):
-        """Get a list of all importers available.
-
-        The search for available importers is done in two steps:
-
-        1) Look for a utility providing ICSVDataReceiver,
-
-        2) For every item of that utility: try to get an adapter
-           providing IWAeUPCSVImporter.
-        """
-        result = []
-        receivers = self.getReceivers()
-        files = self.getFiles()
-        for receiver in receivers:
-            for file in files:
-                wrapped_file = getCSVFile(file.context)
-                try:
-                    importer = getMultiAdapter((wrapped_file, receiver),
-                                           IWAeUPCSVImporter)
-                    result.append(importer)
-                except:
-                    # No multi-adapter for this combination available...
-                    pass
-        return result
-    
     def getFiles(self, sort='name'):
         """Get a list of files stored in `storage`.
@@ -171,90 +124,4 @@
         return not_copied
 
-    def getCSVDataReceivers(self, obj):
-        """Get a list of attributes, that can receive CSV data.
-
-        We also get a list of values, if obj is a container that
-        contains value items.
-        """
-        result = []
-        for attr_name in dir(obj):
-            if attr_name.startswith('_'):
-                continue
-            try:
-                attr = getattr(obj, attr_name)
-                # This might fail...
-                #IWAeUPCSVImporter(attr)
-                result.append(attr)
-            except:
-                pass
-        if hasattr(obj, 'values'):
-            try:
-                result.extend(obj.values())
-            except:
-                pass
-        return result
-
-    def getPossibleImports(self):
-        """Get list of possible imports.
-
-        A single import is defined as a tuple
-        
-          ( <file-descr>, <importers> )
-        
-        where ``<file-descr>`` is an `IDataCenterFile` object and
-        ``<importers>`` is a list of `IWAeUPCSVImporter` objects.
-        """
-        result = []
-        importers = self.getImporters()
-        for filedescr in self.getFiles():
-            possible_importers = []
-            for importer in importers:
-                if importer.csvfile.path != filedescr.context:
-                    continue
-                importer_context = (
-                    importer, self.getReceiverId(importer.receiver))
-                possible_importers.append(importer_context)
-            if len(possible_importers) == 0:
-                continue
-            result.append((filedescr, possible_importers))
-        return result
-
-    def getReceiverId(self, obj):
-        """Get a unique id for an object.
-
-        If the object is stored in ZODB it should contain a `_p_oid`
-        attribute, which is guaranteed to be unique over the ZODB.
-
-        If the object has no such attribute, then it will be held in
-        memory only and will vanish as soon as the request is over. In
-        this case we can use the memory address of it.
-
-        Both, the id() result and the ZODB oid, are actually integers
-        which we return as strings. To make the difference chrystal
-        clear, we prepend ``z`` to ids taken from ZODB oids.
-        """
-        if not hasattr(obj, '_p_oid'):
-            return str(id(obj))
-        oid = getattr(obj, '_p_oid')
-        if oid is None:
-            # The persistent object is not stored in the ZODB
-            return str(id(obj))
-        return 'z%s' % struct.unpack('>Q', oid)[0]
-
-    def doImport(self, path, receiverid, clear=None):
-        receivers = self.getReceiverIds()
-        if receiverid not in receivers.keys():
-            raise ValueError('The requested data receiver cannot be found.')
-        receiver = receivers[receiverid]
-        filewrapper = getCSVFile(path)
-        if filewrapper is None:
-            raise ValueError('Format of CSV file not supported.')
-        importer = getMultiAdapter((filewrapper, receiver), IWAeUPCSVImporter)
-        if clear is not None:
-            importer.doImport(clear_old_data=clear)
-        else:
-            importer.doImport()
-        return
-
     def _moveFile(self, source, dest):
         """Move file source to dest preserving ctime, mtime, etc.
@@ -422,14 +289,5 @@
     def getSourcePath(self):
         return self._getMarker('source') or None
-    
-class Import(object):
-    """Helper class to aggregate imports and their data.
-    """
-    def __init__(self, filedescr, importers):
-        self.file = filedescr
-        self.importers = []
-        for importer, receiverid in importers:
-            importer.receiverid = receiverid
-            self.importers.append(importer)
+
 
 class DataCenterStorageMovedEvent(ObjectEvent):
