mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 10:36:52 -07:00
Remove unnecessary dict factory for database.
This commit is contained in:
parent
713f1a14f3
commit
d3bbcb6b63
1 changed files with 1 additions and 11 deletions
|
@ -37,10 +37,7 @@ class DBConnection(object):
|
|||
|
||||
self.filename = filename
|
||||
self.connection = sqlite3.connect(db_filename(filename), 20)
|
||||
if row_type == 'dict':
|
||||
self.connection.row_factory = self._dict_factory
|
||||
else:
|
||||
self.connection.row_factory = sqlite3.Row
|
||||
self.connection.row_factory = sqlite3.Row
|
||||
|
||||
def check_db_version(self):
|
||||
result = None
|
||||
|
@ -214,13 +211,6 @@ class DBConnection(object):
|
|||
for column in cursor
|
||||
}
|
||||
|
||||
# http://stackoverflow.com/questions/3300464/how-can-i-get-dict-from-sqlite-query
|
||||
def _dict_factory(self, cursor, row):
|
||||
return {
|
||||
col[0]: row[idx]
|
||||
for idx, col in enumerate(cursor.description)
|
||||
}
|
||||
|
||||
|
||||
def sanity_check_database(connection, sanity_check):
|
||||
sanity_check(connection).check()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue