Merge branch 'master' of ssh://git.onelab.eu/git/sfa-gui marcoy-dev master
Thierry Parmentelat [Wed, 8 Sep 2010 09:06:43 +0000 (11:06 +0200)]
SfaData.py

index 433868e..aea1ba4 100644 (file)
@@ -14,12 +14,14 @@ class SfaData:
                  }
 
     def __init__(self):
-        filename = os.path.expanduser("~/.sfi/sfi_config")
-        execfile(filename, SfaData.__dict__)
+        self.filename = os.path.expanduser("~/.sfi/sfi_config")
+        execfile(self.filename, SfaData.__dict__)
         for (k,v) in SfaData.defaults.items():
             if not hasattr(SfaData,k): setattr(SfaData,k,v)
+    
+    def show(self,classname):
         if SfaData.SFAUI_VERBOSE:
-            print "After reading config from %s"%filename
+            print "instance of %s after reading config from %s"%(classname,self.filename)
             for (k,v) in SfaData.defaults.items():
                 print "%-20s: %r"%(k,getattr(SfaData,k))
 
@@ -131,28 +133,34 @@ class PlanetLabData(SfaData):
 class PLEData(PlanetLabData):
     def __init__(self):
         PlanetLabData.__init__(self)
-        self.SFI_SM = "http://www.planet-lab.eu:12346"
+        SfaData.SFI_REGISTRY = "http://www.planet-lab.eu:12345"
+        SfaData.SFI_SM = "http://www.planet-lab.eu:12346"
+        self.show("PlanetLabData")
 
 class PLJData(PlanetLabData):
     def __init__(self):
         PlanetLabData.__init__(self)
-        self.SFI_SM = "http://www.planet-lab.jp:12346"
+        SfaData.SFI_SM = "http://www.planet-lab.jp:12346"
+        self.show("PLJData")
 
 class ViniData(PlanetLabData):
     def __init__(self):
         PlanetLabData.__init__(self)
-        self.SFI_SM = "http://www.vini-veritas.net:12346"
+        SfaData.SFI_SM = "http://www.vini-veritas.net:12346"
+        self.show("ViniData")
 
 class GpENIData(PlanetLabData):
     def __init__(self):
         PlanetLabData.__init__(self)
-        self.SFI_SM = "http://198.248.241.100:12346"
+        SfaData.SFI_SM = "http://198.248.241.100:12346"
+        self.show("GpENIData")
 
 class OpenCirrusData(SfaData):
     def __init__(self):
         SfaData.__init__(self)
         self.SFI_REGISTRY = "http://198.55.37.29:12345"
-        self.SFI_SM = "http://198.55.37.29:12346"
+        SfaData.SFI_SM = "http://198.55.37.29:12346"
+        self.show("OpenCirrusData")
 
     def refreshRSpec(self):
         xml = SfaData.getRSpec(self)