Index: trunk/ippToPsps/jython/batch.py
===================================================================
--- trunk/ippToPsps/jython/batch.py	(revision 31469)
+++ trunk/ippToPsps/jython/batch.py	(revision 31720)
@@ -73,5 +73,5 @@
 
         # open config
-        doc = ElementTree(file="config.xml")
+        self.doc = ElementTree(file="config.xml")
 
         if self.survey != "":
@@ -79,11 +79,14 @@
    
             # get dvo info from config
-            dvoName = doc.find("dvo_" + self.survey + "/name").text
-            self.dvoLocation = doc.find("dvo_" + self.survey + "/location").text
+            dvoName = self.doc.find("dvo_" + self.survey + "/name").text
+            self.dvoLocation = self.doc.find("dvo_" + self.survey + "/location").text
         else:
             dvoName = ""
             self.dvoLocation = ""
             self.surveyID = -1;
-         
+       
+        # get some options from the config
+        self.dataRelease = self.doc.find("metadata/dataRelease").text
+
         # get datastore info from config
         self.datastore = Datastore(self.logger)
@@ -98,5 +101,5 @@
         # get local storage location from config
         self.batchName = "B%08d" % self.batchID
-        self.subDir = doc.find("localOutPath").text + "/" + self.getPspsBatchType() + "/" + dvoName
+        self.subDir = self.doc.find("localOutPath").text + "/" + self.getPspsBatchType() + "/" + dvoName
         self.localOutPath = self.subDir + "/" + self.batchName 
         if not os.path.exists(self.localOutPath): os.makedirs(self.localOutPath)
@@ -156,5 +159,6 @@
 
         found = False
-        
+       
+        origIndex = file.tell()
         while True:
            
@@ -175,5 +179,7 @@
             file.seek(index + 2880, 0)
             
-        if found != True: 
+        if found != True:
+
+            file.seek(origIndex, 0)
             self.logger.error("...could not read header in extension '" + name + "'")
             return
@@ -238,4 +244,6 @@
     def createTarball(self):
       
+        if self.doc.find("options/createTarball").text == "false": return
+
         # set up filenams and paths
         tarFile = self.batchName + ".tar"
@@ -263,4 +271,6 @@
     '''
     def publishToDatastore(self):
+
+        if self.doc.find("options/publishToDatastore").text == "false": return
 
         if self.datastore.publish(self.batchName, self.subDir, self.tarballFile, "tgz"):
@@ -462,4 +472,6 @@
     def reportNullsInAllPspsTables(self, showPartials):
 
+        if self.doc.find("options/reportNulls").text == "false": return
+
         for table in self.pspsTables:
             self.scratchDb.reportNulls(table.name, showPartials)
@@ -515,5 +527,5 @@
 
         self.createEmptyPspsTables()
-        self.importIppTables()
+        #self.importIppTables()
         if self.populatePspsTables():
             if self.exportPspsTablesToFits():
@@ -521,5 +533,5 @@
                 self.createTarball()
                 self.publishToDatastore()
-                #self.reportNullsInAllPspsTables(False)
+                self.reportNullsInAllPspsTables(False)
                 #sys.exit()
         self.logger.info("Finished.")
