Browse Source

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

Maxime Alves LIRMM@home 3 years ago
parent
commit
07b9590b1f
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      pyheatpump/db.py

+ 2
- 3
pyheatpump/db.py View File

@@ -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…
Cancel
Save