Disable SSL warning in Log, clean Futurewarnings

This commit is contained in:
tomkat83 2016-03-23 16:57:49 +01:00
parent 9a049854dc
commit 3a4349e647
4 changed files with 22 additions and 9 deletions

View file

@ -51,6 +51,7 @@ from threading import Thread
import Queue
import traceback
import requests
import xml.etree.ElementTree as etree
import re
import json
@ -58,7 +59,10 @@ from urllib import urlencode, quote_plus, unquote
from PlexFunctions import PlexToKodiTimefactor, PMSHttpsEnabled
import xml.etree.ElementTree as etree
# Disable requests logging
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
@utils.logging
@ -191,12 +195,12 @@ class PlexAPI():
# Wait for approx 30 seconds (since the PIN is not visible anymore :-))
while count < 30:
xml = self.CheckPlexTvSignin(identifier)
if xml:
if xml is not False:
break
# Wait for 1 seconds
xbmc.sleep(1000)
count += 1
if not xml:
if xml is False:
# Could not sign in to plex.tv Try again later
dialog.ok(self.addonName, string(39305))
return False
@ -260,7 +264,7 @@ class PlexAPI():
identifier = None
# Download
xml = self.TalkToPlexServer(url, talkType="POST")
if not xml:
if xml is False:
return code, identifier
try:
code = xml.find('code').text

View file

@ -15,6 +15,10 @@ import xbmcvfs
import utils
import image_cache_thread
# Disable requests logging
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
###############################################################################

View file

@ -3,6 +3,10 @@ import utils
import xbmc
import requests
# Disable requests logging
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
@utils.logging
class image_cache_thread(threading.Thread):

View file

@ -326,7 +326,7 @@ class LibrarySync(Thread):
# Get the Plex item's metadata
xml = PlexFunctions.GetPlexMetadata(plexId)
if not xml:
if xml is None:
self.logMsg("Could not download metadata, aborting time sync", -1)
return
libraryId = xml[0].attrib['librarySectionID']
@ -1215,7 +1215,7 @@ class LibrarySync(Thread):
viewName = view['name']
allPlexTvShows = PlexFunctions.GetPlexSectionResults(
viewId, containerSize=self.limitindex)
if not allPlexTvShows:
if allPlexTvShows is None:
self.logMsg(
"Error downloading show view xml for view %s" % viewId, -1)
continue
@ -1242,7 +1242,7 @@ class LibrarySync(Thread):
# Grab all seasons to tvshow from PMS
seasons = PlexFunctions.GetAllPlexChildren(
tvShowId, containerSize=self.limitindex)
if not seasons:
if seasons is None:
self.logMsg(
"Error downloading season xml for show %s" % tvShowId, -1)
continue
@ -1267,7 +1267,7 @@ class LibrarySync(Thread):
# Grab all episodes to tvshow from PMS
episodes = PlexFunctions.GetAllPlexLeaves(
view['id'], containerSize=self.limitindex)
if not episodes:
if episodes is None:
self.logMsg(
"Error downloading episod xml for view %s"
% view.get('name'), -1)
@ -1365,7 +1365,7 @@ class LibrarySync(Thread):
viewName = view['name']
itemsXML = PlexFunctions.GetPlexSectionResults(
viewId, args=urlArgs, containerSize=self.limitindex)
if not itemsXML:
if itemsXML is None:
self.logMsg("Error downloading xml for view %s"
% viewId, -1)
continue
@ -1407,6 +1407,7 @@ class LibrarySync(Thread):
except Exception as e:
utils.window('emby_dbScan', clear=True)
self.logMsg('LibrarySync thread crashed', -1)
self.logMsg('Error message: %s' % e, -1)
# Library sync thread has crashed
xbmcgui.Dialog().ok(
heading=self.addonName,