Browse Source

Merge branch 'sqlwrapper_obj' for bugfixes

Yann Weber 9 years ago
parent
commit
59f75eddbd
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      Database/sqlwrapper.py

+ 6
- 6
Database/sqlwrapper.py View File

97
 started')
97
 started')
98
             return False
98
             return False
99
 
99
 
100
-        c.rengine = c._getEngine(read=True, sqlaloggingi=None)
100
+        c.rengine = c._getEngine(read=True, sqlalogging=None)
101
         c.wengine = c._getEngine(read=False, sqlalogging=None)
101
         c.wengine = c._getEngine(read=False, sqlalogging=None)
102
         return True
102
         return True
103
 
103
 
110
     
110
     
111
     @classmethod
111
     @classmethod
112
     def _sqllog(c,sqlalogging = None):
112
     def _sqllog(c,sqlalogging = None):
113
-        return bool(sqlalogging) if sqlalogging != None else c.sqlalogging
113
+        return bool(sqlalogging) if sqlalogging != None else c.sqla_logging
114
 
114
 
115
     @classmethod
115
     @classmethod
116
     def _getEngine(c, read=True, sqlalogging = None):
116
     def _getEngine(c, read=True, sqlalogging = None):
175
             - dbread (mandatory if no default db)
175
             - dbread (mandatory if no default db)
176
             - dbwrite (mandatory if no default db)
176
             - dbwrite (mandatory if no default db)
177
         """
177
         """
178
-        return True #TODO desactivate because buggy
179
         err = []
178
         err = []
180
         if 'db' not in c.config:
179
         if 'db' not in c.config:
181
             err.append('Missing "db" in configuration')
180
             err.append('Missing "db" in configuration')
187
                 if 'dbwrite' not in c.config:
186
                 if 'dbwrite' not in c.config:
188
                     err.append('Missing "dbwrite" in configuration and\
187
                     err.append('Missing "dbwrite" in configuration and\
189
  no "default" db declared')
188
  no "default" db declared')
190
-            for db in c.config['db']:
189
+            for dbname in c.config['db']:
190
+                db = c.config['db'][dbname]
191
                 if 'ENGINE' not in db:
191
                 if 'ENGINE' not in db:
192
                     err.append('Missing "ENGINE" in database "'+db+'"')
192
                     err.append('Missing "ENGINE" in database "'+db+'"')
193
                 else:
193
                 else:
209
 '+ename+'"')
209
 '+ename+'"')
210
 
210
 
211
         if len(err)>0:
211
         if len(err)>0:
212
-            err_str = ""
212
+            err_str = "\n"
213
             for e in err:
213
             for e in err:
214
-                err_str += e+"\n"
214
+                err_str += "\t\t"+e+"\n"
215
             raise NameError('Configuration errors in LODEL2SQLWRAPPER\
215
             raise NameError('Configuration errors in LODEL2SQLWRAPPER\
216
 :'+err_str)
216
 :'+err_str)
217
                 
217
                 

Loading…
Cancel
Save