Explorar el Código

[db] when launching with cli, python complains about the global connection variable

Maxime Alves LIRMM@home hace 3 años
padre
commit
07b9590b1f
Se han modificado 1 ficheros con 2 adiciones y 3 borrados
  1. 2
    3
      pyheatpump/db.py

+ 2
- 3
pyheatpump/db.py Ver fichero

@@ -13,8 +13,8 @@ conn = None
13 13
 def connect():
14 14
     global conn
15 15
     if conn is None:
16
-        logger.info('Will connect to database {}'.format(
17
-            config['heatpump']['database']))
16
+        # logger.info('Will connect to database {}'.format(
17
+        #    config['heatpump']['database']))
18 18
         conn = sqlite3.connect(config['heatpump']['database'])
19 19
         conn.row_factory = sqlite3.Row
20 20
     return conn
@@ -33,7 +33,6 @@ def initialize(filename):
33 33
 
34 34
 
35 35
 def sql(query):
36
-    global conn
37 36
     if conn is None:
38 37
         connect()
39 38
 

Loading…
Cancelar
Guardar