Index: trunk/ippToPsps/jython/config.py
===================================================================
--- trunk/ippToPsps/jython/config.py	(revision 33261)
+++ trunk/ippToPsps/jython/config.py	(revision 33358)
@@ -18,97 +18,19 @@
     Basically reads the entire config and stores values to class variables
     '''
-    def __init__(self, path):
+    def __init__(self, programName, name):
 
-        self.path = path
+        self.programName = programName
+        self.name = name
+        self.settingsPath = "../config/settings.xml" # TODO
         self.logger = None
+
+        self.settingsDoc = ElementTree(file=self.settingsPath)
+        self.logPath = self.settingsDoc.find("logPath").text
+
 
         # this is the border (in degrees) that we place around any loading box of 
         # PS1 pointings to ensure we pull a large enough area out of DVO
         self.BORDER = 1.6
-        self.refresh()
-
-    def refresh(self):
-
-        try:
-            self.logger.infoPair("Reading config from", self.path)
-        except: pass
-        self.doc = ElementTree(file=self.path)
-
-        # test mode?
-        if int(self.doc.find("options/testMode").text) == 1: 
-            self.test = True
-        else:
-            self.test = False
-
-        # location for data
-        self.basePath = self.doc.find("localOutPath").text
-
-        # DVO stuff
-        self.dvoLabel = self.doc.find("dvo/gpc1Label").text
-        self.dvoLocation = self.doc.find("dvo/location").text
-
-        # other options
-        self.epoch = self.doc.find("options/epoch").text
-        self.survey = self.doc.find("options/survey").text
-        self.pspsSurvey = self.doc.find("options/pspsSurvey").text
-        self.dataRelease = int(self.doc.find("metadata/dataRelease").text)
-
-        # get RA/Dec limits, if any
-        try: self.minRa = float(self.doc.find("dvo/minRA").text)
-        except: self.minRa = 0.0
-        try: self.maxRa = float(self.doc.find("dvo/maxRA").text)
-        except: self.maxRa = 360.0
-        try: self.minDec = float(self.doc.find("dvo/minDec").text)
-        except: self.minDec = -30.0
-        try: self.maxDec = float(self.doc.find("dvo/maxDec").text)
-        except: self.maxDec = 90.0
-
-        # loading box size, if none set to default
-        try: self.boxSize = float(self.doc.find("dvo/boxSize").text)
-        except: self.boxSize = 4.0
-        self.halfBox = self.boxSize/2.0
-        self.boxSizeWithBorder = self.boxSize + (self.BORDER * 2)
-
-        # datastore stuff
-        self.datastoreProduct = self.doc.find("datastore/product").text
-        self.datastoreType = self.doc.find("datastore/type").text
-        if int(self.doc.find("options/publishToDatastore").text) == 1: 
-            self.datastorePublishing = True
-        else:
-            self.datastorePublishing = False
-
-        # forcing?
-        if int(self.doc.find("options/force").text) == 1: 
-            self.force = True
-        else:
-            self.force = False
-
-        # reporting NULLS in tables?
-        if int(self.doc.find("options/reportNulls").text) == 1: 
-            self.reportNulls = True
-        else:
-            self.reportNulls = False
-
-        # get batch types to load
-        self.batchTypes = []
-        if int(self.doc.find("options/queueP2").text) == 1: self.batchTypes.append("P2")
-        if int(self.doc.find("options/queueST").text) == 1: self.batchTypes.append("ST")
-
-        # get IDs if any are set
-        self.ids = []
-        try:
-            for element in self.doc.findall('options/ids/id'):
-                self.ids.append(int(element.text))
-        except:
-            pass
-
-        # deletion policy
-        if int(self.doc.find("deletion/local").text) == 1: self.deleteLocal = True
-        else: self.deleteLocal = False
-        if int(self.doc.find("deletion/datastore").text) == 1: self.deleteDatastore = True
-        else: self.deleteDatastore = False
-        if int(self.doc.find("deletion/dxlayer").text) == 1: self.deleteDxLayer = True
-        else: self.deleteDxLayer = False
-
+        self.isLoaded = False
 
     '''
@@ -119,5 +41,5 @@
         try:
             self.logger.infoSeparator()
-            self.logger.infoPair("Config path", self.path)
+            self.logger.infoPair("Config name", self.name)
             self.logger.infoPair("Survey", self.survey)
             self.logger.infoPair("Publishing to PSPS as survey", self.pspsSurvey)
@@ -126,7 +48,6 @@
             self.logger.infoBool("Test mode?", self.test)
             self.logger.infoBool("Forcing?", self.force)
-            self.logger.infoPair("Number of ids loaded from config", "%d" % len(self.ids))
             self.logger.infoBool("Reporting NULLS?", self.reportNulls)
-            for batchType in self.batchTypes: logger.infoPair("Queuing batch type", batchType)
+            for batchType in self.batchTypes: self.logger.infoPair("Queuing batch type", batchType)
         except:
             pass
@@ -143,9 +64,9 @@
     Creates a logger object and returns it
     '''
-    def getLogger(self, name, stdout=1, sendToFile=0):
+    def getLogger(self, host, pid, stdout=1, sendToFile=0):
         
         logging.setLoggerClass(PSLogger)
-        self.logger = logging.getLogger(name)
-        self.logger.setup(name, self.basePath, self.dvoLabel, stdout, sendToFile)
+        self.logger = logging.getLogger(self.programName)
+        self.logger.setup(self.programName, self.logPath, self.name, host, pid, stdout, sendToFile)
 
         return self.logger
@@ -194,5 +115,5 @@
         try:
             self.logger.infoPair("RA limits", "%.1f -> %.1f" % (self.minRa, self.maxRa))
-            self.logger.infoPair("Dec limits", "%.1f -> %.1f" % (self.minDec, self.minDec))
+            self.logger.infoPair("Dec limits", "%.1f -> %.1f" % (self.minDec, self.maxDec))
             self.logger.infoPair("Loading box size", "%.1f degrees" % self.boxSize)
         except:
@@ -203,8 +124,8 @@
     Various db metadata getters
     '''
-    def getDbName(self, dbType): return self.doc.find(dbType +"/name").text
-    def getDbHost(self, dbType): return self.doc.find(dbType +"/host").text
-    def getDbUser(self, dbType): return self.doc.find(dbType +"/user").text
-    def getDbPassword(self, dbType): return self.doc.find(dbType +"/password").text
+    def getDbName(self, dbType): return self.settingsDoc.find(dbType +"/name").text
+    def getDbHost(self, dbType): return self.settingsDoc.find(dbType +"/host").text
+    def getDbUser(self, dbType): return self.settingsDoc.find(dbType +"/user").text
+    def getDbPassword(self, dbType): return self.settingsDoc.find(dbType +"/password").text
 
 
