From 82c31e06724424514a65b9979516c39d6415cab2 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Sat, 5 Nov 2016 16:15:07 -0500 Subject: [PATCH] Don't import DatabaseConn initialized This creates import loops. It's always better to initialize them within the class' __init__ --- resources/lib/read_embyserver.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/lib/read_embyserver.py b/resources/lib/read_embyserver.py index 3c1718dd..b829df21 100644 --- a/resources/lib/read_embyserver.py +++ b/resources/lib/read_embyserver.py @@ -8,8 +8,8 @@ import hashlib import xbmc import downloadutils +import database from utils import window, settings -from database import DatabaseConn from contextlib import closing ################################################################################################# @@ -27,7 +27,7 @@ class Read_EmbyServer(): def __init__(self): self.doUtils = downloadutils.DownloadUtils().downloadUrl - + self.database = database.DatabaseConn self.userId = window('emby_currUser') self.server = window('emby_server%s' % self.userId) @@ -107,7 +107,7 @@ class Read_EmbyServer(): viewId = view['Id'] # Compare to view table in emby database - with DatabaseConn('emby') as conn: + with self.database('emby') as conn: with closing(conn.cursor()) as cursor: query = ' '.join((