Index: sansdataloader/src/sans/dataloader/loader.py
===================================================================
--- sansdataloader/src/sans/dataloader/loader.py	(revision 371cb85b0c40eb940e7b6c183b34791575781567)
+++ sansdataloader/src/sans/dataloader/loader.py	(revision f60a8c20e2f0018d19feff6fc41e188d2939a7e4)
@@ -1,27 +1,25 @@
-
+"""
+    File handler to support different file extensions.
+    Uses reflectometry's registry utility.
+    
+    The default readers are found in the 'readers' sub-module
+    and registered by default at initialization time.
+    
+    To add a new default reader, one must register it in
+    the register_readers method found in readers/__init__.py.
+    
+    A utility method (find_plugins) is available to inspect
+    a directory (for instance, a user plug-in directory) and
+    look for new readers/writers.
+"""
 #####################################################################
 #This software was developed by the University of Tennessee as part of the
 #Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
-#project funded by the US National Science Foundation. 
+#project funded by the US National Science Foundation.
 #See the license text in license.txt
 #copyright 2008, University of Tennessee
 ######################################################################
 
-"""
-    File handler to support different file extensions.
-    Uses reflectometry's registry utility.
-    
-    The default readers are found in the 'readers' sub-module
-    and registered by default at initialization time.
-    
-    To add a new default reader, one must register it in
-    the register_readers method found in readers/__init__.py. 
-    
-    A utility method (find_plugins) is available to inspect 
-    a directory (for instance, a user plug-in directory) and
-    look for new readers/writers.
-"""
-
-import os 
+import os
 import sys
 import logging
@@ -55,5 +53,5 @@
         readers.read_associations(self)
         
-        #TODO: remove the following line when ready to switch to 
+        #TODO: remove the following line when ready to switch to
         #the new default readers
         #readers.register_readers(self._identify_plugin)
@@ -62,5 +60,4 @@
         #self.find_plugins('plugins')
 
-        
     def load(self, path, format=None):
         """
@@ -68,10 +65,10 @@
 
         :param path: file path
-        :param format: explicit extension, to force the use 
+        :param format: explicit extension, to force the use
             of a particular reader
 
         Defaults to the ascii (multi-column) reader
         if no reader was registered for the file's
-        extension.   
+        extension.
         """
         try:
@@ -107,5 +104,5 @@
         dir = temp_path
         # Check whether the directory exists
-        if not os.path.isdir(dir): 
+        if not os.path.isdir(dir):
             msg = "DataLoader couldn't locate DataLoader plugin folder."
             msg += """ "%s" does not exist""" % dir
@@ -157,9 +154,9 @@
                         logging.error(msg)
                      
-        return readers_found 
+        return readers_found
     
     def associate_file_type(self, ext, module):
         """
-        Look into a module to find whether it contains a 
+        Look into a module to find whether it contains a
         Reader class. If so, APPEND it to readers and (potentially)
         to the list of writers for the given extension
@@ -226,5 +223,5 @@
                 type_name = loader.type_name
                 
-                wcard = "%s files (*%s)|*%s" % (type_name, ext.lower(), 
+                wcard = "%s files (*%s)|*%s" % (type_name, ext.lower(),
                                                 ext.lower())
                 if wcard not in self.wildcards:
@@ -237,5 +234,4 @@
         return reader_found
 
-    
     def _identify_plugin(self, module):
         """
@@ -268,5 +264,5 @@
                                                      ext.lower())
                     if wcard not in self.wildcards:
-                    	self.wildcards.append(wcard)
+                        self.wildcards.append(wcard)
                             
                 # Check whether writing is supported
@@ -275,5 +271,5 @@
                         if ext not in self.writers:
                             self.writers[ext] = []
-                        self.writers[ext].insert(0,loader.write)
+                        self.writers[ext].insert(0, loader.write)
                         
             except:
@@ -288,5 +284,5 @@
         
         :Raises ValueError: if file type is not known.
-        """        
+        """
         # Find matching extensions
         extlist = [ext for ext in self.extensions() if path.endswith(ext)]
@@ -301,5 +297,6 @@
             result = []
             for L in writers:
-                if L not in result: result.append(L)
+                if L not in result:
+                    result.append(L)
             writers = L
         # Raise an error if there are no matching extensions
@@ -316,5 +313,5 @@
         Raises KeyError if format is not available.
         
-        May raise a writer-defined exception if writer fails.        
+        May raise a writer-defined exception if writer fails.
         """
         if format is None:
@@ -326,7 +323,7 @@
                 return fn(path, data)
             except:
-                pass # give other loaders a chance to succeed
+                pass  # give other loaders a chance to succeed
         # If we get here it is because all loaders failed
-        raise # reraises last exception
+        raise  # reraises last exception
 
         
@@ -340,5 +337,5 @@
     def associate_file_type(self, ext, module):
         """
-        Look into a module to find whether it contains a 
+        Look into a module to find whether it contains a
         Reader class. If so, append it to readers and (potentially)
         to the list of writers for the given extension
@@ -394,16 +391,2 @@
     def get_wildcards(self):
         return self.__registry.wildcards
-        
-if __name__ == "__main__": 
-    logging.basicConfig(level=logging.INFO,
-                        format='%(asctime)s %(levelname)s %(message)s',
-                        filename='loader.log',
-                        filemode='w')
-    l = Loader()
-    test_data = l.load('test/cansas1d.xml')
-    l.save('test_file.xml', test_data, '.xml')
-    
-    print l.get_wildcards()
-        
-        
-    
