Index: trunk/ippToPsps/jython/batch.py
===================================================================
--- trunk/ippToPsps/jython/batch.py	(revision 33235)
+++ trunk/ippToPsps/jython/batch.py	(revision 33259)
@@ -30,6 +30,5 @@
     def __init__(self, 
                  logger, 
-                 configPath,
-                 doc,
+                 config,
                  gpc1Db,
                  ippToPspsDb,
@@ -42,6 +41,5 @@
         self.everythingOK = False
         self.readHeader = False
-        self.configPath = configPath
-        self.doc = doc
+        self.config = config
         self.fits = fits
         self.useFullTables = useFullTables
@@ -75,10 +73,5 @@
                return
 
-        # get info from config
-        self.survey = self.doc.find("options/survey").text
-        self.pspsSurvey = self.doc.find("options/pspsSurvey").text
-        self.dvoGpc1Label = self.doc.find("dvo/gpc1Label").text
-        self.dvoLocation = self.doc.find("dvo/location").text
-        self.scratchDb = ScratchDb(logger, self.doc, self.useFullTables)
+        self.scratchDb = ScratchDb(logger, self.config, self.useFullTables)
 
         if not self.scratchDb.everythingOK: return
@@ -87,28 +80,23 @@
         self.tablesToExport = []
 
-        if self.survey != "":
-            self.surveyID = self.scratchDb.getSurveyID(self.survey)
+        if self.config.survey != "":
+            self.surveyID = self.scratchDb.getSurveyID(self.config.survey)
         else:
             self.surveyID = -1;
        
-        # get some options from the config
-        self.testMode = int(self.doc.find("options/testMode").text)
-        self.dataRelease = int(self.doc.find("metadata/dataRelease").text)
-
         # create datastore object
-        self.datastore = Datastore(self.logger, self.doc, self.ippToPspsDb)
+        self.datastore = Datastore(self.logger, self.config, self.ippToPspsDb)
 
         # get local storage location from config
         self.batchName = Batch.getNameFromID(self.batchID)
-        self.basePath = self.doc.find("localOutPath").text
         self.subDir = Batch.getSubDir(
-                self.basePath,
+                self.config.basePath,
                 self.batchType, 
-                self.dvoGpc1Label)
+                self.config.dvoLabel)
 
         self.localOutPath = Batch.getOutputPath(
-                self.basePath,
+                self.config.basePath,
                 self.batchType, 
-                self.dvoGpc1Label,
+                self.config.dvoLabel,
                 self.batchID)
 
@@ -125,8 +113,5 @@
         self.logger.infoTitle("New " + self.batchType + " batch")
         self.logger.infoPair("Batch name", self.batchName)
-        self.logger.infoPair("Survey", self.survey)
         self.logger.infoPair("Survey ID", "%d" % self.surveyID)
-        self.logger.infoPair("Publishing to PSPS as survey", self.pspsSurvey)
-        self.logger.infoPair("DVO location", self.dvoLocation)
         self.logger.infoBool("Use full DVO tables?", self.useFullTables)
 
@@ -227,5 +212,5 @@
          if value != "NULL": return value
          else:
-             if not self.testMode: return "NULL"
+             if not self.config.test: return "NULL"
              header[key] = default
              self.logger.infoPair("Hardcoding " + key + " to", header[key])
@@ -256,5 +241,5 @@
         root.attrib['type'] = self.batchType
         root.attrib['timestamp'] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") 
-        if self.batchType != "IN": root.attrib['survey'] = self.pspsSurvey
+        if self.batchType != "IN": root.attrib['survey'] = self.config.pspsSurvey
         try: self.minObjID
         except: pass
@@ -287,7 +272,7 @@
         # set up filenams and paths
         tarFile = Batch.getTarFile(self.batchID)
-        tarPath = Batch.getTarPath(self.basePath, self.batchType, self.dvoGpc1Label, self.batchID)
+        tarPath = Batch.getTarPath(self.config.basePath, self.batchType, self.config.dvoLabel, self.batchID)
         tarballFile = Batch.getTarballFile(self.batchID)
-        tarballPath = Batch.getTarballPath(self.basePath, self.batchType, self.dvoGpc1Label, self.batchID)
+        tarballPath = Batch.getTarballPath(self.config.basePath, self.batchType, self.config.dvoLabel, self.batchID)
 
         # tar directory
@@ -498,5 +483,5 @@
 
         # TODO path to DVO prog hardcoded temporarily
-        cmd = "../src/dvograbber " + self.configPath + " " + self.dvoLocation
+        cmd = "../src/dvograbber " + self.config.path + " " + self.config.dvoLocation
         self.logger.infoPair("Running DVO", cmd)
         p = Popen(cmd, shell=True, stdout=PIPE)
@@ -537,5 +522,5 @@
             else:
                 self.writeBatchManifest()
-                if int(self.doc.find("options/publishToDatastore").text): 
+                if self.config.datastorePublishing: 
                     # tar and zip ready for publication to datastore
                     if self.tarAndZip():
@@ -544,5 +529,5 @@
                         Batch.publishToDatastore(self.datastore, self.batchID, self.batchName, self.subDir, tarballFile)
 
-                if int(self.doc.find("options/reportNulls").text): self.reportNullsInAllPspsTables(False)
+                if self.config.reportNulls: self.reportNullsInAllPspsTables(False)
 
 from datastore import Datastore
