Index: conduit/Vfs.py
===================================================================
--- conduit/Vfs.py	(revision 1337)
+++ conduit/Vfs.py	(working copy)
@@ -121,7 +121,7 @@
     try:
         return gnomevfs.exists(gnomevfs.URI(uri)) == 1
     except Exception, err:
-        print err
+        log.warn("Error checking if location exists")
         return False
         
 def uri_make_directory_and_parents(uri):
Index: conduit/datatypes/File.py
===================================================================
--- conduit/datatypes/File.py	(revision 1337)
+++ conduit/datatypes/File.py	(working copy)
@@ -35,9 +35,6 @@
         #optional args
         self.basePath = kwargs.get("basepath","")
         self.group = kwargs.get("group","")
-        
-        #calculate the relative path
-        self.relpath = self._get_text_uri().replace(self.basePath,"")
 
         #instance
         self.fileInfo = None
@@ -167,7 +164,6 @@
         self.URI = f.URI
         self.basePath = f.basePath
         self.group = f.group
-        self.relpath = f.relpath
         self.fileInfo = f.fileInfo
         self.fileExists = f.fileExists
         self.triedOpen = f.triedOpen
@@ -416,6 +412,12 @@
             return u
         else:
             return self.to_tempfile()
+            
+    def get_relative_uri(self):
+        """
+        @returns: The files URI relative to its basepath
+        """
+        return self._get_text_uri().replace(self.basePath,"")
 
     def compare(self, B, sizeOnly=False, existOnly=False):
         """
@@ -480,7 +482,6 @@
         data = DataType.DataType.__getstate__(self)
         data['basePath'] = self.basePath
         data['group'] = self.group
-        data['relpath'] = self.relpath
         data['filename'] = self.get_filename()
         data['filemtime'] = self.get_mtime()
 
@@ -497,7 +498,6 @@
         self.URI = gnomevfs.URI(name)
         self.basePath = data['basePath']
         self.group = data['group']
-        self.relpath = data['relpath']
         self._defer_rename(data['filename'])
         self._defer_new_mtime(data['filemtime'])
 
Index: conduit/dataproviders/File.py
===================================================================
--- conduit/dataproviders/File.py	(revision 1337)
+++ conduit/dataproviders/File.py	(working copy)
@@ -214,14 +214,15 @@
             newURI = self.folder+os.sep+vfsFile.get_filename()
         else:
             #Look for corresponding groups
+            relpath = vfsFile.get_relative_uri()
             if self.folderGroupName == vfsFile.group:
                 log.debug("FolderTwoWay: Found corresponding group")
                 #put in the folder
-                newURI = self.folder+vfsFile.relpath
+                newURI = self.folder+relpath
             else:
                 log.debug("FolderTwoWay: Recreating group %s --- %s --- %s" % (vfsFile._get_text_uri(),vfsFile.basePath,vfsFile.group))
                 #unknown. Store in the dir but recreate the group
-                newURI = self.folder+os.sep+os.path.join(vfsFile.group+vfsFile.relpath)
+                newURI = self.folder+os.sep+os.path.join(vfsFile.group+relpath)
 
         destFile = File.File(URI=newURI)
         comp = vfsFile.compare(
Index: conduit/dataproviders/VolumeFactory.py
===================================================================
--- conduit/dataproviders/VolumeFactory.py	(revision 1337)
+++ conduit/dataproviders/VolumeFactory.py	(working copy)
@@ -47,20 +47,6 @@
                 self.item_removed(device_udi)
         return False
 
-    def probe(self):
-        """
-        Called after VolumeFactory is initialised to detect already connected volumes
-        """
-        for volume in self.vol_monitor.get_mounted_volumes():
-            device_udi = volume.get_hal_udi()
-            if device_udi != None:
-                props = self._get_properties(device_udi)
-                if self.is_interesting(device_udi, props):
-                    mount, label = self._get_device_info(props)
-                    kwargs = { "mount": mount, "label": label }
-                    print device_udi, kwargs
-                    self.item_added(device_udi, **kwargs)
-
     def _get_properties(self, device_udi):
         try:
             device_dbus_obj = self.bus.get_object("org.freedesktop.Hal" ,device_udi)
@@ -82,6 +68,19 @@
             label = ""
 
         return (mount, label)
+        
+    def probe(self):
+        """
+        Called after VolumeFactory is initialised to detect already connected volumes
+        """
+        for volume in self.vol_monitor.get_mounted_volumes():
+            device_udi = volume.get_hal_udi()
+            if device_udi != None:
+                props = self._get_properties(device_udi)
+                if self.is_interesting(device_udi, props):
+                    mount, label = self._get_device_info(props)
+                    kwargs = { "mount": mount, "label": label }
+                    self.item_added(device_udi, **kwargs)
 
     def get_args(self, udi, **kwargs):
         """ VolumeFactory passes mount point and udi to dataproviders """
Index: conduit/dataproviders/DataProvider.py
===================================================================
--- conduit/dataproviders/DataProvider.py	(revision 1341)
+++ conduit/dataproviders/DataProvider.py	(working copy)
@@ -49,7 +49,7 @@
     _out_type_ = ""
     _in_type_ = ""
     
-    def __init__(self):
+    def __init__(self, *args):
         """
         All sync functionality should be provided by derived classes
         """
@@ -79,6 +79,10 @@
         self.emit("change-detected")
         self.pendingChangeDetected = False
 
+    @classmethod
+    def get_init_args(cls):
+        return ()
+
     def emit(self, *args):
         """
         Override the gobject signal emission so that all signals are emitted 
@@ -209,10 +213,7 @@
     def configure(self, window):
         """
         Show a configuration box for configuring the dataprovider instance.
-        This call may block
-        
-        @param window: The parent window (to show a modal diaconduit.log)
-        @type window: {gtk.Window}
+        @param window: The parent gtk.Window (to show a modal dialog)
         """
         log.debug("configure() not overridden by derived class %s" % self._name_)
 
Index: conduit/modules/FileModule/FileModule.py
===================================================================
--- conduit/modules/FileModule/FileModule.py	(revision 1340)
+++ conduit/modules/FileModule/FileModule.py	(working copy)
@@ -6,14 +6,15 @@
 import conduit
 import conduit.dataproviders.DataProvider as DataProvider
 import conduit.dataproviders.File as FileDataProvider
+import conduit.dataproviders.VolumeFactory as VolumeFactory
 import conduit.dataproviders.AutoSync as AutoSync
 import conduit.Utils as Utils
 import conduit.Vfs as Vfs
 
 MODULES = {
-	"FileSource" :      { "type": "dataprovider" },
-	"FolderTwoWay" :    { "type": "dataprovider" },
-#    "USBFactory" :      { "type": "dataprovider-factory" }
+	"FileSource" :              { "type": "dataprovider" },
+	"FolderTwoWay" :            { "type": "dataprovider" },
+#    "RemovableDeviceFactory" :  { "type": "dataprovider-factory" }
 }
 
 class FileSource(FileDataProvider.FileSource):
@@ -67,10 +68,10 @@
 
     def __init__(self, *args):
         FileDataProvider.FolderTwoWay.__init__(self,
-                FolderTwoWay.DEFAULT_FOLDER,
-                FolderTwoWay.DEFAULT_GROUP,
-                FolderTwoWay.DEFAULT_HIDDEN,
-                FolderTwoWay.DEFAULT_COMPARE_IGNORE_MTIME
+                self.DEFAULT_FOLDER,
+                self.DEFAULT_GROUP,
+                self.DEFAULT_HIDDEN,
+                self.DEFAULT_COMPARE_IGNORE_MTIME
                 )
         AutoSync.AutoSync.__init__(self)
         self._monitor_folder_id = None
@@ -79,6 +80,10 @@
         if self._monitor_folder_id != None:
             Vfs.monitor_cancel(self._monitor_folder_id)
             self._monitor_folder_id = None
+            
+    @classmethod
+    def get_init_args(self):
+        return ("FOO",)
 
     def configure(self, window):
         Utils.dataprovider_add_dir_to_path(__file__, "")
@@ -88,10 +93,10 @@
         self._monitor_folder()
         
     def set_configuration(self, config):
-        self.folder = config.get("folder", FolderTwoWay.DEFAULT_FOLDER)
-        self.folderGroupName = config.get("folderGroupName", FolderTwoWay.DEFAULT_GROUP)
-        self.includeHidden = config.get("includeHidden", FolderTwoWay.DEFAULT_HIDDEN)
-        self.compareIgnoreMtime = config.get("compareIgnoreMtime", FolderTwoWay.DEFAULT_COMPARE_IGNORE_MTIME)
+        self.folder = config.get("folder", self.DEFAULT_FOLDER)
+        self.folderGroupName = config.get("folderGroupName", self.DEFAULT_GROUP)
+        self.includeHidden = config.get("includeHidden", self.DEFAULT_HIDDEN)
+        self.compareIgnoreMtime = config.get("compareIgnoreMtime", self.DEFAULT_COMPARE_IGNORE_MTIME)
         self._monitor_folder()
 
     def get_configuration(self):
@@ -128,46 +133,42 @@
         elif event == Vfs.MONITOR_EVENT_DELETED:
             self.handle_deleted(event_uri)
 
-class USBFactory(DataProvider.DataProviderFactory):
+class RemovableDeviceFactory(VolumeFactory.VolumeFactory):
+
     def __init__(self, **kwargs):
-        DataProvider.DataProviderFactory.__init__(self, **kwargs)
+        VolumeFactory.VolumeFactory.__init__(self, **kwargs)
+        self.foo = {}
 
-        if kwargs.has_key("hal"):
-            self.hal = kwargs["hal"]
-            self.hal.connect("usb-added", self._usb_added)
-            self.hal.connect("usb-removed", self._usb_removed)
+    def _make_class(self, folder, name):
+        klass = type(
+                "FolderTwoWay",
+                (FolderTwoWay,),
+                {"DEFAULT_FOLDER":folder,"DEFAULT_GROUP":group}
+                )
+        return klass
 
-        self.usb = {}
+    def is_interesting(self, udi, props):
+        if props.has_key("info.parent") and props.has_key("info.parent") != "":
+            prop2 = self._get_properties(props["info.parent"])
+            if prop2.has_key("storage.removable") and prop2["storage.removable"] == True:
+                mount,label = self._get_device_info()
+                #check for the presence of mount/.conduit/group file(s)
+                #which describe the groups, and their names, on the volume
+                path = Vfs.uri_join(mount,".conduit",Utis.get_user_string())
+                if Vfs.uri_exists(path):
+                    self.foo[udi] = [self._make_class("/tmp",i) for i in range(2)]
+                return True
+        return False
+    
+    def get_category(self, udi, **kwargs):
+        return DataProviderCategory.DataProviderCategory(
+                    kwargs['label'],
+                    "multimedia-player-ipod-video-white",
+                    udi)
 
-    def probe(self):
-        """
-        Probe for USB Keys that are already attached
-        """
-        for device_type, udi, mount, name in self.hal.get_all_usb_keys():
-            self._usb_added(None, udi, mount, name)
+    def get_dataproviders(self, udi, **kwargs):
+         return self.foo[udi]
+         
+    def get_args(self, udi, **kwargs):
+        return ()
 
-    def _usb_added(self, hal, udi, mount, name):
-        """
-        New USB key has been discovered
-        """
-        cat = DataProvider.DataProviderCategory(
-                    name,
-                    "drive-removable-media",
-                    mount)
-
-        keys = []
-        for klass in [FileSource]:
-            key = self.emit_added(
-                           klass,            # Dataprovider class
-                           (mount,udi,),     # Init args
-                           cat)              # Category..
-            keys.append(key)
-
-        self.usb[udi] = keys
-
-    def _usb_removed(self, hal, udi, mount, name):
-        for key in self.usb[udi]:
-            self.emit_removed(key)
-
-        del self.usb[udi]
-
Index: conduit/Module.py
===================================================================
--- conduit/Module.py	(revision 1337)
+++ conduit/Module.py	(working copy)
@@ -116,17 +116,10 @@
         return res            
        
     def _is_module(self, filename):
-        """
-        Tests whether the filename has the appropriate extension.
-        """
-        endswith = "Module.py"
-        isModule = filename[-len(endswith):] == endswith
-        return isModule
+        return filename.endswith("Module.py")
 
     def _is_module_dir(self, dirname):
-        endswith = "Module"
-        isModuleDir = dirname[-len(endswith):] == endswith
-        return isModuleDir
+        return dirname.endswith("Module")
         
     def _append_module(self, wrapper, klass):
         """
@@ -137,7 +130,7 @@
         @type module: L{conduit.ModuleManager.ModuleWrapper}
         """
         #Check if the class is unique
-        classname = klass.__name__
+        classname = wrapper.classname
         if classname not in self.classRegistry:
             self.classRegistry[classname] = klass
         else:
@@ -210,7 +203,7 @@
                                             out_type=getattr(klass, "_out_type_", ""),
                                             filename=filename,
                                             classname=klass.__name__,
-                                            initargs=(),
+                                            initargs=klass.get_init_args(),
                                             enabled=True
                                             )
                         #Save the module (signal is emitted _append_module
@@ -280,9 +273,7 @@
         if wrapperKey in self.moduleWrappers:
             #Get the existing wrapper
             m = self.moduleWrappers[wrapperKey]
-            #Get its construction args
-            classname = m.classname
-            initargs = m.initargs
+            #Make a copy of it, containing an instantiated module
             mod_wrapper = ModuleWrapper(  
                                 name=m.name, 
                                 description=m.description,
@@ -292,9 +283,9 @@
                                 in_type=m.in_type,
                                 out_type=m.out_type,
                                 filename=m.filename,
-                                classname=classname,
-                                initargs=initargs,
-                                module=self._instantiate_class(classname, initargs),
+                                classname=m.classname,
+                                initargs=m.initargs,
+                                module=self._instantiate_class(m.classname, m.initargs),
                                 enabled=True
                                 )
         else:
