]> kaliko git repositories - mpd-sima.git/blobdiff - sima/lib/simadb.py
Cleanup linter warnings
[mpd-sima.git] / sima / lib / simadb.py
index 1fbd93c96dedd09d81887ed182fe48666cd41b3e..5e22f021635bc77b0eda39d81ca5b905cbe2c534 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (c) 2009-2013 Jack Kaliko <jack@azylum.org>
+# Copyright (c) 2009-2013, 2019-2020 kaliko <kaliko@azylum.org>
 # Copyright (c) 2009, Eric Casteleijn <thisfred@gmail.com>
 # Copyright (c) 2008 Rick van Hattem
 #
@@ -42,20 +42,17 @@ class SimaDBError(Exception):
     """
     Exceptions.
     """
-    pass
 
 
 class SimaDBAccessError(SimaDBError):
     """Error on accessing DB file"""
-    pass
 
 
 class SimaDBNoFile(SimaDBError):
     """No DB file present"""
-    pass
 
 
-class SimaDB(object):
+class SimaDB:
     "SQLite management"
 
     def __init__(self, db_path=None):
@@ -85,7 +82,7 @@ class SimaDB(object):
     def get_database_connection(self):
         """get database reference"""
         connection = sqlite3.connect(
-            self._db_path, timeout=5.0, isolation_level="immediate")
+            self._db_path, timeout=5.0, isolation_level=None)
         #connection.text_factory = str
         return connection
 
@@ -324,6 +321,8 @@ class SimaDB(object):
 
     def get_artists_history(self, artists, duration=__HIST_DURATION__):
         """
+        :param list artists: list of object that can evaluate equality with
+                             artist name, iterable of str or Artist object
         """
         date = datetime.utcnow() - timedelta(hours=duration)
         connection = self.get_database_connection()