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

View file

@ -15,6 +15,10 @@ import xbmcvfs
import utils import utils
import image_cache_thread 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 xbmc
import requests import requests
# Disable requests logging
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
@utils.logging @utils.logging
class image_cache_thread(threading.Thread): class image_cache_thread(threading.Thread):

View file

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