Added field position in Slab RSpec , which include posx , posy
[sfa.git] / sfa / senslab / slabpostgres.py
index a133833..c327024 100644 (file)
@@ -69,7 +69,7 @@ class SliceSenslab (SlabBase):
         result += ">"
         return result
           
-    def dumpquerytodict(self):
+    def dump_sqlalchemyobj_to_dict(self):
         dict = {'slice_hrn':self.slice_hrn,
         'peer_authority':self.peer_authority,
         'record_id':self.record_id_slice, 
@@ -94,9 +94,15 @@ class SliceSenslab (SlabBase):
         #return result
           
 class SlabDB:
-    def __init__(self,config):
+    def __init__(self,config, debug = False):
         self.sl_base = SlabBase
         dbname="slab_sfa"
+        if debug == True :
+            l_echo_pool = True
+            l_echo=True 
+        else :
+            l_echo_pool = False
+            l_echo = False 
         # will be created lazily on-demand
         self.slab_session = None
         # the former PostgreSQL.py used the psycopg2 directly and was doing
@@ -114,7 +120,7 @@ class SlabDB:
             (config.SFA_DB_USER,config.SFA_DB_PASSWORD,config.SFA_DB_HOST,config.SFA_DB_PORT,dbname)
         for url in [ unix_url, tcp_url ] :
             try:
-                self.slab_engine = create_engine (url,echo_pool=True,echo=True)
+                self.slab_engine = create_engine (url,echo_pool = l_echo_pool, echo = l_echo)
                 self.check()
                 self.url=url
                 return